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

preview_player
Показать описание
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';
Рекомендации по теме
Комментарии
Автор

Very nice tutorial clear all fundamentals of laravel

rakeshsingh
Автор

Hi Polo, I appreciate your excellent tutorial, thanks!

FlightPhysical
Автор

wow what a command on coding and designing... really superb ... you explain it very clearly .... thank you so much.

akky-
Автор

thanks for this awesome tutorial..
its help me so much :)

papakencen
Автор

Excellent tutorials sir.it is really help me so much.
we are waiting for your next laravel tutorials.

masudparbhez
Автор

Awesome tutorial @polodev. Very easy to understand. Keep it up!!

jkchoge
Автор

Brilliant! Thank you for this great tutorial. Cheers

RicardodelRosal
Автор

Thank you sir for your awesome tutorial... you are a icon to us

LOLEmpireOfficial
Автор

Such a nice way you guid us into details of laravel

ghulammustafa
Автор

Thanks for the video. Perfect and smooth explanation.

meteyilmaz
Автор

Awesome tutorial bro. I love the way you taught. so easy to understand. Please upload more videos. Good luck.

rahulteja
Автор

thoroughly explained. fixed a bunch of errors in my code. thanks.

genichiro
Автор

thnks ....its really helps me lotsss...keep upload more videos... you explained so smoothly...

jalpachavda
Автор

So Simple and understandable Video, Thanks a lot for you help man.

daniyalmazari
Автор

Congratulations for this job! Very very good! Excellent tutorial Its help me so much ;)

lindembergcordeiro
Автор

This is the best tutorial. Thanks so much men

eduardoflores
Автор

Thank you so much for this tutorial! It helps a lot! ;)

AriesVincentDajay
Автор

Awesome Tutorial brother. Please make a full series of laravel from basic to professional. "Ar aro valo lagse j apni bangli, valo hobe jodi tutorial gula banglay koren."

MdHasan-hdpd
Автор

I am still watching it but So far it is very awesome..

brianhumphrey
Автор

Nice and good looking. Maybe I missed something. I made a second user and was able to edit and delete my first user's posts. But also I know we did not add the user to the database. More information about csrf will help. For instance using this worked: {{ csrf_field() }}. Thanks very much.

jonathanengwall
join shbcf.ru