laravel

Function for resend email takes me to the home page and does nothing in the given function - Laravel

荒凉一梦 提交于 2021-02-10 03:15:14
问题 I have this simple function on click to send email to the users if the first one after registration didnt go. But when i click on the button it doesn nothing and takes me to the home page. The resend function: protected function resend() { $user = Account::where('email', Auth::user()->email)->first(); $user->verifyToken = Str::random(40); $user->save(); $this->sendEmail($user); return redirect(route('verifyEmail'))->with('user',$user)->with('success', 'A link has been sent to your email'); }

proper use of Laravel's paginate method?

笑着哭i 提交于 2021-02-10 03:08:30
问题 When I use the paginate method with the following statement: $user = User::where('id', 1)->first(); $images = $user->images->paginate(3); I get the following error: Method Illuminate\Database\Eloquent\Collection::paginate does not exist However when I call it with the following statement: $images = Image::where('user_id', $user->id)->paginate(3); It works accordingly... I'm fairly new to Laravel, so forgive my ignorance, but what is the cause of the difference in results? Don't both statement

Laravel 6.0 app.js only has require('.bootstrap');?

懵懂的女人 提交于 2021-02-09 11:53:09
问题 I just started learning how to work with a Laravel server and I want to use Vue . But after installing the app.js file only has require('/bootstrap'); in it, shouldn't it have the required components and the const app field? I used npm install and npm run watch . What am I doing wrong? 回答1: Laravel 6 doesn't ship with frontend scaffolding anymore, they shipped that to a new package called Laravel UI so install it and scaffold VueJS composer require laravel/ui php artisan ui vue And if you

How to refresh the component after the queue job is finished?

匆匆过客 提交于 2021-02-09 11:12:34
问题 I have a table products and job_statuses using this package: laravel-job-status There is a column in job_statuses called status the package made this column finished once the queue job is finished! So I created a column in products table called job_status_id (relation with job_statuses) just to save the job status id in the products table to see if this job is finished! Simply I created a component using Livewire for just refresh single product when the job finished refresh the component:

How to refresh the component after the queue job is finished?

狂风中的少年 提交于 2021-02-09 11:12:00
问题 I have a table products and job_statuses using this package: laravel-job-status There is a column in job_statuses called status the package made this column finished once the queue job is finished! So I created a column in products table called job_status_id (relation with job_statuses) just to save the job status id in the products table to see if this job is finished! Simply I created a component using Livewire for just refresh single product when the job finished refresh the component:

Auth guard driver [api] is not defined?

两盒软妹~` 提交于 2021-02-09 11:06:15
问题 I use this library jwt-auth-guard in Laravel 5.3. When I try open page I get error: InvalidArgumentException in AuthManager.php line 99: Auth guard driver [api] is not defined. How can I fix it? I made everything that was need 回答1: I'm not sure, please check you guard driver setup into config/auth.php first. You can cross check this from GIT repo. Let me know if any concern from above. 回答2: If you are using tymondesigns/jwt-auth package first check that you are downloading the latest version

how to pass a variable to service provider in Laravel?

不问归期 提交于 2021-02-09 09:23:40
问题 I want to generate a dynamic menu in a sidebar and share with all the views in Laravel 5.1. like: - Marks Module - Langosh Topic - Content 1 - Content 2 -Nitzsche Topic - Content 3 - Rolfson Module Although All this elements belong another entity called course which I can select in the Top menu (users can have more than 1 course). So every time that I access, Course, Module, Topic or Content they need to tell the sidebar menu which course is the father (or grandfather) of all of those kids to

how to pass a variable to service provider in Laravel?

限于喜欢 提交于 2021-02-09 09:15:07
问题 I want to generate a dynamic menu in a sidebar and share with all the views in Laravel 5.1. like: - Marks Module - Langosh Topic - Content 1 - Content 2 -Nitzsche Topic - Content 3 - Rolfson Module Although All this elements belong another entity called course which I can select in the Top menu (users can have more than 1 course). So every time that I access, Course, Module, Topic or Content they need to tell the sidebar menu which course is the father (or grandfather) of all of those kids to

VUE2 component register in Laravel

老子叫甜甜 提交于 2021-02-08 23:50:24
问题 Laravel(5.8) and VUE work very nice togheter, but my app.js is getting to big. For example, i have the following app.js: window.Vue = require('vue'); window.Vue.component('Comp1', require('./components/Comp1.vue').default); window.Vue.component('Comp2', require('./components/Comp2.vue').default); window.Vue.component('Comp3', require('./components/Comp3.vue').default); window.mainApp = new Vue({ el: '#app' }); In the real case, I have around 30 components + third party, witch results in a 1

Skip Laravel's FormRequest Validation

大城市里の小女人 提交于 2021-02-08 19:35:44
问题 I've recently added HaveIBeenPwned to my form request class to check for cracked passwords. Given that this makes an external API call, is there a way for me to skip either this validation rule or the FormRequest class altogether during testing? Here's the request I make in my test. $params = [ 'first_name' => $this->faker->firstName(), 'last_name' => $this->faker->lastName(), 'email' => $email, 'password' => '$password', 'password_confirmation' => '$password', 'terms' => true, 'invitation' =