Why redirect() not working in laravel 5 constructor

why redirect() is working in routes and methods only.

So for getting the advantage of redirection in constructor, we have to use a special function.


For using the above function we need to add a below line of code in Controller :-

use Illuminate\Support\Facades\Redirect;

Note :- here userLogin our routes name

Check it also

check for the documentation

How ngModel Can’t bind not a known property of input in Angular

For using ngModel ,You should include FormsModule first in your application.

because by default angular does not recognise the “ngModel“.


Steps for adding  FormsModule in your code are .

Open your app.module.ts file.

import the line : – import { FormsModule } from ‘@angular/forms’;

and also add the FormsModule in imports array like this :-

imports: [

Check it also

check for the documentation

why Base table : 1146 ‘database.tables’ doesn’t exist laravel 5

This is the very common error occurs for beginners.

Error is like, the table is not exist which the user wants to use”.

As per the laravel documentation, it is good to make the table name in plurals.

For example you have given the table name is “user” .

But laravel is searching for the table name as “users”, because by the documentation name should be “users” ,that’s why  error is occuring.
So for resolving this we have to define the exact table name in the model as we have given the table name:-

For Example – We have a shayari model class looking like this


namespace App;

use Illuminate\Database\Eloquent\Model;

class shayari extends Model
protected $fillable = [‘cat_id’,’sub_cat_id’,’image’,’status’];

In above model class we have given statically our exact table name, which we wants to use.

Than above model class will looking like this after the updation.

class shayari extends Model
protected $table = ‘shayari ‘;
protected $fillable = [‘cat_id’,’sub_cat_id’,’image’,’status’];

As we have the shayari model.In which we can clearly see that we have mentioned the exact table name.

So laravel will not looking for a plural name of a table and it will not throw  “table does not exist error”.

Check it also

check for the documentation

How Fatal Error App\Http\Controllers\ not found


In this Fatal Error App\Http\Controllers\ not found the laravel wants to show that the model you want to use that is not available in your scope.

What does it mean thal model is not in scope for laravel ?

Laravel searching for the model class which is not included in page/controller.

So before use any model in controller you have to include  or use that  into your controller.

Note:-Above given error is very generic. It is not only for model.

it can be for session,file system ,encryption,database and many more .

So whenever this kind of error is occurred for session,database,file and so on ,than simple is that you have not included that class which you wants to use.


here wallpaper is our table name or model name, we are trying to use that in our controller but we have not included that
so  just add :-
use App\wallpaper; // or whatever your model location
into your working controller file

Check it also

check for the documentation

why laravel routes not working after server shift


“laravel routes not working properly” .

This is very common issue occured when the laravel project shifted from local host to main server.

The cause of this issue is apache configuration.It means when the project shifted, the apache requires some configuration to handling the shifting mechanism.

This is the issue of the apache2 configuration files
can be fix easily
1- go to the apache2.conf  file can be found in
2-open the above file with any editor for example :-
sudo vi /etc/apache2/apache2.conf
3- than search for below block of code
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted

and replace the above code as below code

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
4-restart the apache2 server
sudo service apache2 restart
5-issue fix

Check it as well

Check for forum as well

Why laravel 5.2 throws internal server error

why laravel  5 throws internal server error ?

Error is coming due to insufficient file permission ,

just  gave the folder called bootstrap and storage 777 permission,

but if you put the laravel project into a sub folder on the server.

than give the whole folder 777 permission ,

your issue will be resolved

There are two ways to give permission to these two folders :-

1- From the file properties dialogue box.

2-From the command line.

But most of the time ,when permission given by the method 1 i.e from the file properties , permission some time works and some time not so the recommend ways to give the permission is by the command line :

Step to get into command line:-

Open the putty Software

Fill the host name and click on ssh than auth than upload the .ppk file for your server and click on open and you will be on the command line.

locate to your project by cd command , let say my project in /var/www/html directory, than command will be

1-cd /var/www/html

than give permission to bootstrap and storage folder

sudo chmod -R 777 storage – hit enter

sudo chmod -R 777 bootstrap- hit enter

now you done.

Check it also

check for the documentation

how to move laravel project to server

The answer of “how to move laravel project to server” is very simple :-

There several ways to do this ,here i am going to tell you the simplest one :

1-Copy all the files of your laravel 5 project from localhost.

2-Paste them into the root of your server / if you wants to run your project into sub domain then paste all the files inside the sub folder .

3-Give the permission of 777 to Bootstrap and Storage folder of laravel project if you paste the files in root

4- give the permission 777 to whole folder in case you running the project into sub domain or any other folder inside your root .

5-Update the database credentials into .env file

6-done,now access your project.

Check it also


How to add css and js in laravel 5

How to add css and js file in laravel 5 is very easy now –

There are several ways to add the css and js links in Laravel 5+


<link href=”{{ asset(‘css/style.css’) }}” rel=”stylesheet” type=”text/css” >

<link href=”{{ URL::asset(‘css/style.css’) }}” rel=”stylesheet” type=”text/css” >

<script type=”text/javascript” src=”{{ asset(‘js/main.js’) }}”></script>

<script type=”text/javascript” src=”{{ URL::asset(‘js/main.js’) }}”></script>

{{ asset(‘img/profile.jpg’); }}

Check it also 

Go for Laravel Documentation