laravel-5

How to fix error Base table or view not found: 1146 Table laravel relationship table?

五迷三道 提交于 2021-01-26 03:10:36
问题 I am a new of laravel I try to create relationship many to many between table,My problem when I am insert data in to database I got errors QueryException in Connection.php line 713: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'learn.category_posts' doesn't exist (SQL: insert into category_posts ( category_id , posts_id ) values (4, )) can anyone help me pls . and here below is my migrate and code: 2016_08_04_131009_create_table_posts.php public function up() { Schema::create(

How to fix error Base table or view not found: 1146 Table laravel relationship table?

我与影子孤独终老i 提交于 2021-01-26 03:08:29
问题 I am a new of laravel I try to create relationship many to many between table,My problem when I am insert data in to database I got errors QueryException in Connection.php line 713: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'learn.category_posts' doesn't exist (SQL: insert into category_posts ( category_id , posts_id ) values (4, )) can anyone help me pls . and here below is my migrate and code: 2016_08_04_131009_create_table_posts.php public function up() { Schema::create(

How can I register custom error handler in laravel 5?

你离开我真会死。 提交于 2021-01-24 12:11:06
问题 I'm developing a Laravel package, have a service provider with views and everything, but I need to have custom error messages. How can I register custom error handler in my service provider? 回答1: You can register custom handler by binding it with Laravel's exception handler class on service provider. Create Custom Handler First you have to create custom exception handler class. <?php namespace App\Exceptions; use Exception; use Illuminate\Auth\AuthenticationException; use Illuminate

How can I register custom error handler in laravel 5?

蓝咒 提交于 2021-01-24 12:10:44
问题 I'm developing a Laravel package, have a service provider with views and everything, but I need to have custom error messages. How can I register custom error handler in my service provider? 回答1: You can register custom handler by binding it with Laravel's exception handler class on service provider. Create Custom Handler First you have to create custom exception handler class. <?php namespace App\Exceptions; use Exception; use Illuminate\Auth\AuthenticationException; use Illuminate

How can I register custom error handler in laravel 5?

此生再无相见时 提交于 2021-01-24 12:07:45
问题 I'm developing a Laravel package, have a service provider with views and everything, but I need to have custom error messages. How can I register custom error handler in my service provider? 回答1: You can register custom handler by binding it with Laravel's exception handler class on service provider. Create Custom Handler First you have to create custom exception handler class. <?php namespace App\Exceptions; use Exception; use Illuminate\Auth\AuthenticationException; use Illuminate

Laravel 5.8 - save user emails encrypted

China☆狼群 提交于 2021-01-24 11:41:46
问题 I'm looking for a way to encrypt the user emails in the database. Since Encrypt always generates a different string, it fails. So I took sha1. in AuthenticatesUsers I've changed the credentials method to: protected function credentials(Request $request) { return ['email' => sha1(strtolower($request->email)), 'password' => ($request->password)]; } This works great for the login/registration. But there are problems with resetting the password. Resetting the password uses the

Mantaining OAuth keys between elastic beanstalk deployment

一笑奈何 提交于 2021-01-22 06:29:06
问题 I have a laravel application run in AWS Elastic Beanstalk environment. I use Laravel Passport to handle the authentication. Every time I run eb deploy the keys will be deleted, since it is not part of the version control files (included in .gitignore). Thus, I have to manually run php artisan passport:keys in the EC2 instance to generate the keys. But this will make all users need to login again because the old token is now invalid, since it's a new key pair. What is the best practice to

Mantaining OAuth keys between elastic beanstalk deployment

落爺英雄遲暮 提交于 2021-01-22 06:28:53
问题 I have a laravel application run in AWS Elastic Beanstalk environment. I use Laravel Passport to handle the authentication. Every time I run eb deploy the keys will be deleted, since it is not part of the version control files (included in .gitignore). Thus, I have to manually run php artisan passport:keys in the EC2 instance to generate the keys. But this will make all users need to login again because the old token is now invalid, since it's a new key pair. What is the best practice to

Finding days between two dates in laravel

不羁的心 提交于 2021-01-21 03:55:10
问题 I have to dates. Now, I need to find the difference between these two for further calculations. I tried different ways but I am not able to fix the issues. Can anyone tell me the best way to do it. My code is: public function leaveRequest(request $request) { $fdate=$request->Fdate; $tdate=$request->Tdate; $start = Carbon::parse($fdate)->format('Y/m/d'); $end = Carbon::parse($tdate)->format('Y/m/d'); $days = $end->diffInDays($start); /*$days=date_diff($end,$start);*/ echo $days; exit; $user =

Finding days between two dates in laravel

牧云@^-^@ 提交于 2021-01-21 03:53:25
问题 I have to dates. Now, I need to find the difference between these two for further calculations. I tried different ways but I am not able to fix the issues. Can anyone tell me the best way to do it. My code is: public function leaveRequest(request $request) { $fdate=$request->Fdate; $tdate=$request->Tdate; $start = Carbon::parse($fdate)->format('Y/m/d'); $end = Carbon::parse($tdate)->format('Y/m/d'); $days = $end->diffInDays($start); /*$days=date_diff($end,$start);*/ echo $days; exit; $user =