laravel-5.2

Auth::attempt() is not working in Laravel 5.5

南笙酒味 提交于 2019-12-08 01:22:38
问题 My registration form is working and it store users to db but when user login then Auth::attempt() return false. Here is my code for login. I store the password in db in sha1 encription. Route::post('login',function(){ $creds=array( 'email' => Input::get('email'), 'password' => sha1(Input::get('password')) ); $auth = Auth::attempt($creds); dd($auth); 回答1: Even though you can implement a Service provider as describe in this post, You can do it manually by with using other auth method This means

Laravel Auth external data for login and register

只谈情不闲聊 提交于 2019-12-08 01:06:45
问题 I am using the Laravel 5.2 Auth system coming up with this command : php artisan make:auth Although this works totally fine as is, my goal is to use an external API to perform login, registering and changing password while still being able to use the core function of the Auth class. So taking the login for example, I want to use something like function login(ApiController $api) { // This function return data or error code and message in JSON $login = $api->login([ $credentials['email'],

Method controller does not exist.

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 00:42:30
问题 So I have used this format again. In my routes.php I have Route::controller('datatables', 'HomeController', [ 'PaymentsData' => 'payments.data', 'getIndex' => 'datatables', ]); In my HomeController.php I have public function getIndex() { return view('payments.index'); } /** * Process datatables ajax request. * * @return \Illuminate\Http\JsonResponse */ public function Payments() { return Datatables::of(DB::table('customer'))->make(true); } Anytime I try php artisan I get

upload my project laravel to a shared host

微笑、不失礼 提交于 2019-12-07 23:23:12
问题 I have a shared hosting service hostinger. as I can upload my laravel 5.2 and configure project? and I tried using: namespace App\Providers; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { // } /** * Register any application services. * * @return void */ public function register() { $this->app->bind('path.public', function () { return base_path() . '/public_html';

If the second page has one item, the pagination is not displayed in laravel 5.3

我的未来我决定 提交于 2019-12-07 22:30:16
问题 let's assume we have 11 items and we set 10 items per page so the second page will have 1 item, in this case the pagination in second page is not displayed but when add another item and the list becomes 12 and the second page has 2 items the pagination is displayed. Controller: $cities = City::orderBy('id', 'desc')->paginate(10); return view('cities.home', compact('cities')); View: <div class="panel-body"> <div class="table-responsive panel panel-sky"> <table class="table table-striped table

Laravel 5.2 queue ignores .env

蹲街弑〆低调 提交于 2019-12-07 19:56:12
问题 I have a Laravel 5.2 app which sends a few emails when a user buys a product. The email view includes references to some images, like so: <img src="{{ asset($purchase->image) }}"> This works fine in all 3 environments I have - local, staging, and production. asset() correctly constructs the fully qualified URLs to the appropriate image, using the configured APP_URLs in each environment. I decided to switch to using Laravel queues to send the emails. I changed the QUEUE_DRIVER in .env to

Laravel 5.2.11, sessions are not working, session cookie not being set

扶醉桌前 提交于 2019-12-07 19:19:34
问题 I'm new to Laravel, I have learned about the models, views, blade, controllers and routes and how they work together. So far everything has been working smoothly. I'm having trouble with sessions though. When I use the AuthController that comes with Laravel and hit auth/register with a POST request, the data for the user that I register does get inserted into the users table (using mysql) and I do get back a response with the "Location" header redirecting to / like it does out of the box. It

Laravel Post Controller not working (Symfony \ Component…)

吃可爱长大的小学妹 提交于 2019-12-07 17:54:06
问题 My entire laravel controller isn't working. When I do a get request to this controller index() it works perfectly. But when I do a post request to this controller to store(), it doesn't work. When I was trying to trouble shoot I started commenting out code or using dd(). Then quickly noticed when I commented out my entire controller it made no change on the error. (or when I dd($user_id) nothing changed). My error: Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException

InvalidArgumentException Please provide a valid cache path Error laravel 5.2

。_饼干妹妹 提交于 2019-12-07 17:49:27
I'm working with Laravel 5.2 and i have an error when i run composer update or artisan optimize .. i've searched on my vendor, i didn't found compiled.php file ! i try to generate this i run the artisan optimize, i have the same error [InvalidArgumentException] Please provide a valid cache path Script php artisan clear-compiled handling the post-update-cmd event returned with error code 1 how i can resolve this ? Please Try it: create these folders under storage/framework : sessions views cache And also you can use this command to install: sudo composer install Its will be working. 来源: https:/

Laravel show form error with form element name as key

喜你入骨 提交于 2019-12-07 13:15:51
问题 I am trying to learn laravel . I know Codeigniter . In codeigniter3 I will get the form error as an array with key as the form name by using the function $this -> form_validation -> error_array(); it will display like array( 'form_element1' => 'this field is required', 'form_element2' => 'this field is required' ) Is there any way in laravel 5 to do the same? Please help. Any help could be appreciated 回答1: Laravel controller uses ValidatesRequests trait which provides a validate method. Here