Tag Archives: laravel

how to set new guard for auth controller in laravel

Questions: I want to make multiple authentication in my laravel project. I create new guard “admin” in my auth.php file but I don’t know how to set new created guard in my authcontroller. It always use “defaults” settings from my auth.php: ‘defaults’ => [ ‘guard’ => ‘web’, ‘passwords’ => ‘users’, ], Answers:

Controller class not found in Laravel 4

Questions: I have the following error while trying to run my controller Controller class not found I have this code in my routes.php file Route::get(‘cms/create-page’, ‘AdminCMSController@create_page’); Route::post(‘cms/createpage’,’AdminCMSController@createpage’); Route::controller(‘cms’,’AdminCMSController’); And this is the code in my Controller class AdminCMSController extends BaseController { public function create_page() { } public function createpage() { } } How can I… Read More »

Laravel TokenMismatchException database session

Questions: My $request->input(_token) is a mismatch of $request->session()->toke() when switching from file to database sessions. This is causing a CSRF TokenMismatchException. When switching back from database to file sessons driver the mismatch does not occur. Does anyone know why i get this mismatch and possibly how to resolve it? 🙂 What i have done: Using… Read More »

Implementing group_by and having in Laravel using Eloquent

Questions: I am having trouble implementing the group_by and having queries using Eloquent in Laravel. Here is the scenario: orders – id – qty deliveries – id – qty – order_id I want to use a join to display the orders with incomplete deliveries as well as the corresponging balance: Order::left_join(‘deliveries’, ‘orders.id’, ‘=’, ‘deliveries.order_id’) ->select(array(‘orders.*’),… Read More »

Laravel FatalErrorException in Handler.php line 25

Questions: I’m getting the following error on random occasions, working on a Laravel 5.1 project on the latest homestead with PHP7 FatalErrorException in Handler.php line 25: Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of TypeError given, called in /home/vagrant/Code/henau/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in /home/vagrant/Code/henau/app/Exceptions/Handler.php:25 Stack trace:… Read More »

laravel blade @include not working

Questions: I am trying to include files in my homepage using blade syntax :- @foreach($data as $articles) @include(app_path().$articles->path) <br /> @endforeach This is not working. The error says :- View [/var/www/blogproject/project/app/pages/articles/first-post.php] not found I even tried including just the first page :- @include(app_path().’/pages/articles/first-post.php’) But the normal php include is working fine :- <?php include(app_path().’/pages/articles/first-post.php’); ?>… Read More »

Laravel TokenMismatchException

Questions: Right now I’m learing laravel but I keep getting the exeption: TokenMismatchException in VerifyCsrfToken.php line 53: I’m trying to make an object of a migration and then write it to the database but for some reason it’s not working. This is my route.php: Route::get(‘/post/new’,array( ‘uses’=> ‘blog@newPost’, ‘as’ => ‘newPost’ )); Route::post(‘/post/new’, array ( ‘uses’… Read More »

TokenMismatchException in VerifyCsrfToken.php line 53 in Laravel 5.1

Questions: When I try to login show me token error. I have checked token in view form it’s right and when comment \App\Http\Middleware\VerifyCsrfToken::class, in the Kernel.php it makes me login but after Redirect to my dashboard I’m not logged in. I am using MAMP on mac. <div> <h1>Login</h1> <div> {!! Form::open([‘url’=>’user/login’,’class’ => ”]) !!} <input… Read More »