laravel-5.8

How to Fix Laravel Email Issue

纵然是瞬间 提交于 2019-12-11 17:35:30
问题 I'm implementing Laravel 5.8 built-in Email Verification feature but unfortunately I couldn't figure the bug. I've added the MustVerifyEmail interface in ,y User Model. This is my .ENV file in Laravel. Same configuration I used in mail.php . .env MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=465 MAIL_USERNAME="<My user Name>" MAIL_PASSWORD="<My Password>" MAIL_ENCRYPTION=ssl 回答1: You have to enable access to less secure apps in your google account security settings. 回答2: For configuring

How to retrieve role/status of authenticated user?

被刻印的时光 ゝ 提交于 2019-12-11 07:33:27
问题 I am new to Laravel. I have included an additional field in the user's table named status using the line of code given in the code part below. I am trying to learn how to redirect the user based on their roles. I understand that to retrieve an authenticated user I can use $user = Auth::user(); My question is how I can get the status of the authenticated user to be used in a redirectTo function that I plan to write. // This is how I have added the user status field: $table->enum('status',[

Laravel: Accessing model attributes in the constructor method

社会主义新天地 提交于 2019-12-11 06:47:35
问题 How to use __construct on laravel eloquent and get attributes. I tired: public function __construct() { parent::__construct(); dd($this->attributes); } My code return null. But on abstract class Model filled all attributes: public function __construct(array $attributes = []) { $this->bootIfNotBooted(); $this->initializeTraits(); $this->syncOriginal(); $this->fill($attributes); } It's possible get access to model attributes in the constructor method? 回答1: Try with accessors . https://laravel

Issue while trying to pass json of translation key-value from laravel blade to vue.js

北战南征 提交于 2019-12-10 15:32:42
问题 This is my translation file return [ "Key1" => "Message 1", "Key2" => "Message 2", "Key3" => "Message 3", "Key4" => "Message 4", "Key5" => "Message 5", "Key6" => "Message 6", "Key7" => "Message 7", "Key8" => "Message 8", ]; This is the code in Laravel Blade <profile v-bind:ErrorMessages= "{ Messages: '{!! json_encode(Lang::get('Profile')) !!}' }"> </profile> In the above component, I am trying to pass the complete translation file from laravel blade to Vue.js But, the above code print all

Laravel Dusk how to get multiple element's attributes?

蹲街弑〆低调 提交于 2019-12-08 01:57:21
问题 I just began using Laravel Dusk on Laravel 5.8 and already faced an issue. Was searching a lot on Google, but haven't found an answer. $browser->visit('https://www.website.com') ->script('window.scrollTo(0, 1000);'); $elems = $browser ->pause(1000) ->elements('.elem a'); This is my current code to get all the links under a certain element on the page. What I want to do is get all the links and get their href attribute or any custom attribute they might have (I want to specify the name if the

laravel socialite not working on live server, only works on local machine

守給你的承諾、 提交于 2019-12-07 13:04:55
问题 I have recently moved my application into a live server. The problem is laravel socialite stopped working, below is the explanation: I click on google login and after choosing email, on callback this happens: InvalidStateException on Abstract.php on line 200. To fixed this issue i used stateless() and now the new error is : Client error: `POST https://www.googleapis.com/oauth2/v4/token` resulted in a `400 Bad Request` response: { "error": "invalid_request", "error_description": "Missing

laravel socialite not working on live server, only works on local machine

我的梦境 提交于 2019-12-06 03:43:09
I have recently moved my application into a live server. The problem is laravel socialite stopped working, below is the explanation: I click on google login and after choosing email, on callback this happens: InvalidStateException on Abstract.php on line 200. To fixed this issue i used stateless() and now the new error is : Client error: `POST https://www.googleapis.com/oauth2/v4/token` resulted in a `400 Bad Request` response: { "error": "invalid_request", "error_description": "Missing required parameter: code" } Here is the list of things i have already tried: 1- In Google website, I updated

Laravel excel 3.1 add extra rows betweem iterations

老子叫甜甜 提交于 2019-12-02 15:52:42
问题 Sorry for my english. I have one to many relationship between two tables one is "alquileres" (rents) and the other is "cobros" (payments). I need to show the totals of each rental like this: what i need But obtain this: result This is the code of my export: class ComprobantesExport implements FromCollection, WithMapping, WithHeadings, ShouldAutoSize, WithEvents { use Exportable, RegistersEventListeners; protected $alquileres; public function __construct($alquileres = null) { $this->alquileres

Laravel excel 3.1 add extra rows betweem iterations

岁酱吖の 提交于 2019-12-02 09:08:11
Sorry for my english. I have one to many relationship between two tables one is "alquileres" (rents) and the other is "cobros" (payments). I need to show the totals of each rental like this: what i need But obtain this: result This is the code of my export: class ComprobantesExport implements FromCollection, WithMapping, WithHeadings, ShouldAutoSize, WithEvents { use Exportable, RegistersEventListeners; protected $alquileres; public function __construct($alquileres = null) { $this->alquileres = $alquileres; } /** * @return \Illuminate\Support\Collection */ public function collection() { return

Laravel Nova - Reorder left navigation menu items

坚强是说给别人听的谎言 提交于 2019-12-01 05:19:38
问题 In default the ordering of left menu items is in alphabetical order. My client wants to order those menus manually. Any idea how to make it possible? 回答1: You can do it in App\Providers\NovaServiceProvider.php add a method resources() and register the resources manually like protected function resources() { Nova::resources([ User::class, Post::class, ]); } 回答2: you can use grouping if that helps. I know it's not a 100% fix but maybe it will help a bit. public static $group = 'Admin'; 来源: