laravel-5.7

Laravel redirects to login after authentication

此生再无相见时 提交于 2021-02-10 08:38:38
问题 PROBLEM I'm busy with my first Laravel app and although I see the benefits of the way things are written, I'm having a hard time understanding some of the behaviour. When I try to login I get redirected to the login page. It seems like the user authenticates correctly, but it redirects to the login page regardless. WHAT I HAVE My users table looks like this: ,---------,---------------,---------------,----------------,---------------,-----------, | user_id | user_username | user_password |

Fleet cart using middlewares in routes but i can not find any $routemiddleware in project…not even in kernel.php …where can i find it?

▼魔方 西西 提交于 2021-02-08 02:12:43
问题 Fleet cart using middlewares in routes but i can not find any $routemiddleware in project...not even in kernel.php ...where can i find it? Laravel Version : 5.7 Passport Version : 7.5 CMS : FleetCart Kernel.php namespace FleetCart\Http; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { /** * The application's global HTTP middleware stack. * * These middleware are run during every request to your application. * * @var array */ protected $middleware = [

Laravel Passport: How to validate client IP when requesting API

半腔热情 提交于 2021-01-29 13:14:04
问题 I'm using Laravel Passport as my API authentication mechanism. Everything is working as expected, but i need to add an extra validation for each request. The idea is to validate the client IP Address alongside the access_token that is sent to the server. Any idea how i can accomplish this? UPDATE: I want to check if the IP used in the authentication (when the user logged in) is the same as the one doing the requestes. If the IP is different, the client must login again. 回答1: Ip address could

How to export csv file with shift-jis encoding in laravel?

偶尔善良 提交于 2021-01-28 11:11:02
问题 I am using laravel-excel to export csv file. To export, the code is like below, return Excel::download(new Export(results,$header), "test.csv"); And the Export.php file is like, namespace App\AllClass; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\Exportable; use Maatwebsite\Excel\Concerns\WithHeadings; class Export implements FromCollection,WithHeadings { private $myArray; private $header; public function __construct($myArray,$header){ $this->myArray =

How to enable both api and web guard in laravel

你。 提交于 2021-01-27 04:27:31
问题 Laravel 5.7 PHP 7.2.10 Currently I am able to use any one of web and api guards, is there any way to allow both, so that both web app and api will work together. Something like return [ /* |-------------------------------------------------------------------------- | Authentication Defaults |-------------------------------------------------------------------------- | | This option controls the default authentication "guard" and password | reset options for your application. You may change

Laravel 5.7 email verification error, route [verification.verify] not defined

余生颓废 提交于 2020-12-25 02:35:00
问题 I am trying to implement email verification in Laravel 5.7. I have implemented MustVerifyEmail on User model. class User extends Authenticatable implements MustVerifyEmail { } But after registration I got this error Route [verification.verify] not defined . What I am missing in this? Please guide? 回答1: Laravel includes the Auth\VerificationController class that contains the necessary logic to send verification links and verify emails. To register the necessary routes for this controller, pass

Laravel 5.7 email verification error, route [verification.verify] not defined

﹥>﹥吖頭↗ 提交于 2020-12-25 02:32:36
问题 I am trying to implement email verification in Laravel 5.7. I have implemented MustVerifyEmail on User model. class User extends Authenticatable implements MustVerifyEmail { } But after registration I got this error Route [verification.verify] not defined . What I am missing in this? Please guide? 回答1: Laravel includes the Auth\VerificationController class that contains the necessary logic to send verification links and verify emails. To register the necessary routes for this controller, pass