laravel-5.4

Sending attachment in laravel mail

六月ゝ 毕业季﹏ 提交于 2019-12-11 15:22:59
问题 everyone. I am trying to send email with attachment on it. What I have done is : controller code snippet: try{ Mail::send(['name' => 'By System'],array(), function($msg) use ($email,$name,$message,$attachment,$ext,$display) { $msg->from('ricket999@gmail.com', 'Markle Admin'); $msg->to($email)->subject('Payment Done') ->setBody('This is to notify you that the employee named '.$name.' has been paid for the monthly payment. Thank You.','text/html') ->attach(public_path().'/'.$attachment, ['as' =

Laravel 5.4 Blade Javascript Google Maps - Insert @foreach with multiple variables

早过忘川 提交于 2019-12-11 14:17:49
问题 I'm following this post which wonderfully shows how to loop through map markers using blade templating within Javascript. I'd like to add on the ability to loop through the content as well. In other words, I'd like to loop through one value, in this case, Props, with multiple parts, in this case, coords and contents. The code below is my latest attempt. I can't get it to work. Any idea where I may be going wrong? Thanks! <script> var map; function initMap() { map = new google.maps.Map

I can't test simple vue example component on Laravel 5.4

对着背影说爱祢 提交于 2019-12-11 10:14:42
问题 I have a fresh laravel 5.4 installation, i run npm install and then proceed to test the example vue component, but nothing happens. On my project's directory I run npm run dev and It compiles just fine. Then I execute php artisan serve and all I see is a blank page. Here's my view, which is the only code I wrote: <html> <head> <title>Laravel</title> </head> <body> <div id="app"> <example></example> </div> <script src="/js/app.js"></script> </body> </html> Is that ok? am I missing something?

Error:While updating form Using Ajax Post method in laravel

左心房为你撑大大i 提交于 2019-12-11 09:45:51
问题 I am trying to update my Laravel form While updating other fields except file field the Laravel I am checking this using hasfile() it's getting failed. If I update the file upload the condition works perfectly the only problem occur while I am updating the other form field without updating the file Here my Controller Page: public function update(Request $request, $id) { $this->validate($request,[ 'design_no'=>'required', 'design_image'=>'image|nullable|max:1999' ]); // Handle file Upload if (

Laravel Check the User Share Telegram Bot Link to other Users

天涯浪子 提交于 2019-12-11 08:52:41
问题 Hi i want to develop the bot , but first i ask users to share the link of my bot to 5 other users then continue and register in my bot , i develop all sections but i cannot handle the first one, how can i detect that the use send share link to other user ? i user laravel + talageram bot SDK to develop my bot. i just want to know that user share the link and continue , i search in many docs and site bud i cannot find anythings that useful to me. please help me to handle this problem in my

Auth::login($user) in laravel not able to login the user

♀尐吖头ヾ 提交于 2019-12-11 07:17:29
问题 I am using laravel 5.4 and Auth::login($user) is showing Type error: Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, instance of Illuminate\Database\Eloquent\Builder given, called in /home/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php on line 294 My User.php file is: namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends

Laravel all sessions IDs with Redis driver

好久不见. 提交于 2019-12-11 07:02:15
问题 In my application I want to allow for some user, to be able to sign out all other users except him/her. I have done this functionality, well, when the Session driver was set to file, but now I'm using redis as session driver and I could not able to find any way to list up all current sessions like I have done when it was file driver. The question is : How to list up all sessions IDs when using redis as a session driver? The following is the code that I have used when session driver was file:

How to query for nested array in php and laravel using mongoDB

孤人 提交于 2019-12-11 06:56:39
问题 I'm using MongoDB with PHP's own driver and I have saved multiple arrays under main document. Structure looks like this: [ { _id: 5, unique: true, name: "Joseph", password: "mangalore" }, { _id: 9, unique: true, name: "John", password: { passcode1: 1, passcode2: 2 } } ] Note: I want to fetch the data where passcode2 > 1 Note: Can u please show me both php and laravel code My code is $id = DB::connection('mongodb') ->collection('login2') ->where(array('password.passcode2','>',2)) ->get();

Laravel Eloquent rollback does not work, for queries separated by PHP functions

ぐ巨炮叔叔 提交于 2019-12-11 06:35:47
问题 I separate the model queries on a trait class, because I hate to read a long block of codes with the model queries, and because I find it convenient if I reused the same function. But I found a problem once an error occur. I was trying to run rollback function from eloquent once an error occur but, unfortunately, rollback wont work as I am expecting. Am I doing it wrong? Are there any other ways to implement this? try { DB::beginTransaction(); // UserDetails $userdetailsID = $this-

Laravel eloquent query

老子叫甜甜 提交于 2019-12-11 06:18:50
问题 I have 3 tables called cash_manages , outlets , and delivery_boys the structure is //outlets id name 1 utha 2 alabama //delivery_boys id outlet_id name 1 1 John 2 1 Mike 3 2 Alex //cash_manage id source_type source_id destination_id status amount 1 admin 1 2 give 500 2 admin 2 1 give 350 3 deliveryBoy 1 2 receive 300 4 admin 2 2 give 500 5 admin 2 1 give 800 6 user 1 1 give 600 7 user 2 2 give 450 //the logic 1-> if source_type is admin then the source_id is outlet_id and the cash is **GIVEN*