Laravel Class not found

i tried lots of things… and after 2 hours here is the solutions php artisan config:cache composer dump-autoload php artisan cache:clear php artisan view:clear And be sure to declare the class in app.cfg

Read More

Create a controller with populated with all the functions a

#php artisan make:controller FlyersController –resource the result is that you will have a controller with all the functions created: <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; class FlyersController extends Controller { /** * Display a listing of the resource. *

Read More

Adding a column to an existing table – Laravel

For example we forgot to add the column password to the table users, and we already have inserted datas in the table. The solution is to 1.we build the migration: php artisan make:migration add_password_to_users –table=users 2.add to the file the

Read More

TokenMismatchException in VerifyCsrfToken.php line 67:

I have a form and when i click the submit button I get the error: TokenMismatchException in VerifyCsrfToken.php line 67:   The fix is to add in the form the input token ring: <input type=”hidden” name=”_token” value=”{{ csrf_token() }}”>

Read More

FatalErrorException in Str.php line 395: Call to undefined function Illuminate\Support\ctype_lower()

the fix is to enable the extension ctype from php.ini before after   and restart the apache serve.

Read More

Used terminal commands laravel

Create a new project in laravel: #laravel new your-project-name Another way to create a new project: #composer create-project laravel/laravel your-project-name Scaffold basic login and registration views and routes – it’s a good idea to do it at the beginning of

Read More

php artisan tinker

This terminal command provides a REPL (Read-Eval-Print Loop) for PHP with your application’s settings already loaded: php artisan tinker You can insert rows in a table: DB::table(‘cards’)->insert([‘title’=>’My First Card’,’created_at’=>DateTime,’updated_at’=>new DateTime]) You can display rows from a table: DB::table(‘cards’)->get(); Get me

Read More

php artisan migrate – error [PDOException] SQLSTATE[HY000] [2002] No such file or directory

/Applications/AMPPS/www/blog/config/database.php I changed the host from localhost into 127.0.0.1 and it worked: ‘host’ => env(‘DB_HOST’, ‘127.0.0.1’),

Read More

SQLSTATE[HY000] [1045] Access denied for user ‘homestead’@’localhost’ (using password: YES)

When I run the command “php artisan migrate” I get the following error message: [PDOException]  SQLSTATE[HY000] [1045] Access denied for user ‘homestead’@’localhost’ (usin g password: YES)        Solution: make sure that you have changed the configs from /Applications/AMPPS/www/blog/config/database.php make sure

Read More