Web Prepration

Web Concept Tutorials

Laravel
Pagination

If you are laravel beginners then this post  can help you that how to add pagination easily  in your blade template. There is no need to implement pagination logic’s and long code write for pagination in laravel because laravel provides own function which generate pagination very simple so let’s select data following way in Controller. Controller File:

In above example you can see now it will return pagination with 15 records if you want to 5 or 25 etc then you can change argument. Now we have to render pagination view so, let’s see view/blade file. Blade File:

 

read more >>
Laravel

If  do you want to get logged in user information in laravel, Laravel auth function provide login user information you need to call Auth::User() function which returns all the details of users and also want to check user login or not then use laravel Auth::check function which return true or false.

 How to create a record in Laravel using eloquent ? To create a new record in the database using Laravel Eloquent, simply create a new model instance, set attributes on the model, then call the save method:  example code give below.

Using save function you can simple insert data in database with all details which passed in request parameters.

read more >>