filmov
tv
laravel 5.6 # create read update delete (crud) authentication pagination in laravel 5.6

Показать описание
In this video, I have shown you how to make create read update delete (crud) application using Laravel 5.6. I have added authentication and pagination functionality to this crud.
source code and text tutorial will be available by the following the link
create read update delete, authentication and pagination in laravel 5.6
basic mvc structure
route
||
controller ==== model
||
view
installing laravel using composer
composer create-project laravel/laravel YourProjectName
command for making model, controller, factory and migration file
php artisan make:model YourModel
php artisan make:controller YourController
php artisan make:migration create_your_table_name
php artisan make:factory YourModel -m "app\yourmodelname"
php artisan make:controller YourController -r
php artisan make:model YourModel -a
connecting with dabase inside .env file . Whenever we change .env file we have to restart our artisan server
DB_DATABASE=blog
DB_USERNAME=root
DB_PASSWORD
Remember to always import class name on top of the file when necessary
defining default string maximum 191 chracter length inside AppServiceProvider boot method
Schema::defaultStringLength(191);
migrating table to database
php artisan migrate
seeding database with dummy data
php artisan db:seed
resource route in laravel
Route::resource('posts', 'PostController');
passing variable in a view
$posts = Post::all();
# cross site request forgery
@csrf
# for update
@method('put')
# for delete
@method('delete')
yielding in master view for content section
@yield('content')
extends master in view file and write content inside content section
@extends('master')
@section('content')
@endsection
iterating variable using blade directives
@foreach($posts as $post)
@endforeach
pagination in laravel
## inside controller
$posts = Post::paginate(10);
## redirect in laravel
redirect('/posts');
redirect(route('login'));
some model (eloquent) query we are use today
## for fetching posts from db
$posts = Post::all();
$posts = Post::paginate(10);
built in authentication in laravel
php artisan make:auth
adding middleware in controller inside construct function
access authenticate user data
how to redirect to certain routes after login or register
protected $redirectTo = '/posts';
source code and text tutorial will be available by the following the link
create read update delete, authentication and pagination in laravel 5.6
basic mvc structure
route
||
controller ==== model
||
view
installing laravel using composer
composer create-project laravel/laravel YourProjectName
command for making model, controller, factory and migration file
php artisan make:model YourModel
php artisan make:controller YourController
php artisan make:migration create_your_table_name
php artisan make:factory YourModel -m "app\yourmodelname"
php artisan make:controller YourController -r
php artisan make:model YourModel -a
connecting with dabase inside .env file . Whenever we change .env file we have to restart our artisan server
DB_DATABASE=blog
DB_USERNAME=root
DB_PASSWORD
Remember to always import class name on top of the file when necessary
defining default string maximum 191 chracter length inside AppServiceProvider boot method
Schema::defaultStringLength(191);
migrating table to database
php artisan migrate
seeding database with dummy data
php artisan db:seed
resource route in laravel
Route::resource('posts', 'PostController');
passing variable in a view
$posts = Post::all();
# cross site request forgery
@csrf
# for update
@method('put')
# for delete
@method('delete')
yielding in master view for content section
@yield('content')
extends master in view file and write content inside content section
@extends('master')
@section('content')
@endsection
iterating variable using blade directives
@foreach($posts as $post)
@endforeach
pagination in laravel
## inside controller
$posts = Post::paginate(10);
## redirect in laravel
redirect('/posts');
redirect(route('login'));
some model (eloquent) query we are use today
## for fetching posts from db
$posts = Post::all();
$posts = Post::paginate(10);
built in authentication in laravel
php artisan make:auth
adding middleware in controller inside construct function
access authenticate user data
how to redirect to certain routes after login or register
protected $redirectTo = '/posts';
Комментарии