Posts

Showing posts from April, 2021

Larvel Auth url Changes

Image
 Check all routes by coomand php artisan route:list Default routes // Authentication Routes... Route::get( 'login' , 'Auth\AuthController@showLoginForm' ); Route::post( 'login' , 'Auth\AuthController@login' ); Route::get( 'logout' , 'Auth\AuthController@logout' ); // Registration Routes... Route::get( 'register' , 'Auth\AuthController@showRegistrationForm' ); Route::post( 'register' , 'Auth\AuthController@register' ); // Password Reset Routes... Route::get( 'password/reset/{token?}' , 'Auth\PasswordController@showResetForm' ); Route::post( 'password/email' , 'Auth\PasswordController@sendResetLinkEmail' ); Route::post( 'password/reset' , 'Auth\PasswordController@reset' ); You can put you all routes in admin by Route::group([ 'prefix' => 'admin' ], function ( ) { Route::auth(); });

Get Route Parameter In Blade Laravel

 If you want to get all parameters and its key in view {{dd(request()->route()->parameters)}} The parameter in  view by its key Route::get('products/{status}', ['uses'=>'ProductController@alldata', 'as'=>'products.alldata']); {{ Request::route('status') }}

Crate Dummy Records In Laravel by Facker Factory

 By Default Laravel gives UserFactory So we can create dummy records for user by folling tnker factory:- php artisan tinker factory(App\User::class, 200)->create(); App\User  User Model Path 200  Number of dummy records you can pass your choice By this we got dummy data in few seconds. Now Creating Factory for  Any Model by one command:- php artisan make:factory ProductFactory or (you can assin model name also) php artisan make:factory ProductFactory --model=Product These factories are placed in database/factories directory. use Faker\Generator as Faker; $factory->define(App\Product::class, function (Faker $faker) {     return [         'title' => $faker->title,         'discription' => $faker->discription,     ]; }); you can assin your field here. php artisan tinker factory(App\Product::class, 50)->create(); After this you got 50 products in few minutes.

Create Datatable in Laravel

Image
 Step 1:- Install Yajra Datatable Package You can install Yajra Datatable package  by following command. composer require yajra/laravel-datatables-oracle  Step 2:-  Add Alias and provider to the app.php config/app.php 'providers' => [ Yajra\DataTables\DataTablesServiceProvider::class, ] 'aliases' => [ 'DataTables' => Yajra\DataTables\Facades\DataTables::class, ]  Step 3:-  Define Route In this we define routes to for view file and getting data and for doing this we need to go web.php routes\web.php Route::get('products', ['uses'=>'ProductController@alldata', 'as'=>'products.alldata']); or Route::get('products', 'ProductController@alldata')->name('products.alldata');  Step 4:-  Define Controller In this step we create a controller as ProductController to display layout, handel request and send responce to view page. app/http/controllers/ProductController.php <?php namespace A...

Nainital 2 Day Trip

Season:   May-June  By Train From Delhi to Kathgodam Station  from there 30km left Then took taxi or public Bus to nainital Day-1 Naina Lake Naina Devi Temple Cave Garden Lake View Point Himalyan View Point Lovers View Point Mall Road Day-2 Zoo Rajbhawan Dorthy Seat Lakes Tour Snow view Point

Import csv file in laravel

           1. I nstall maatwebsite via the Composer package manager                composer require maatwebsite/excel        2.  Then open config/app.php file and add service provider and aliase.           'providers' => [ Maatwebsite\Excel\ExcelServiceProvider::class,           ],           'aliases' => [ 'Excel' => Maatwebsite\Excel\Facades\Excel::class,           ],          3 . Define Routes              In routes/web.php                Route :: get ( ' /upload ' , 'Post Controller@index ' );         Route :: post ( ' /pupload ' , 'Post Controller@uploadp ' )-> name ( ' uploadp ' );       ...

Laravel Model - Controller And Migration Command

 php artisan make:model Flight --m # Generate a model and a FlightFactory class... php artisan make:model Flight --factory php artisan make:model Flight -f # Generate a model and a FlightSeeder class... php artisan make:model Flight --seed php artisan make:model Flight -s # Generate a model and a FlightController class... php artisan make:model Flight --controller php artisan make:model Flight -c # Generate a model and a migration, factory, seeder, and controller... php artisan make:model Flight -mfsc # Generate a model , migration and Controller class... php artisan make:model Contact -cm Create controller php artisan make:controller PhotoController --resource php artisan make:controller PhotoController --resource --model=Photo use App\Http\Controllers\PhotoController; Route::resource('photos', PhotoController::class); Route::resources([     'photos' => PhotoController::class,     'posts' => PostController::class, ]); Verb URI       ...

CMD commands list

Cmd commands For Window 10 mkdir   create a new directory rmdir   delete directory xcopy   copy files   xcopy test.file "to location" del    delete one or more files  del test.file or *.files move   move/rename files  move test.file "tolocation"  ren   rename file     ren test.file  change.file dir   show all directory cls   clear screen time  display time shutdown   shutdown the computer hostname  Display hostname tasklist   display applications taskkill   terminate a process or a application  taskkill \p 9987 wmic cpu   Get details about computer wmic bios get serialnumber  Get bios serial number net user Manju Manju@123 /add  Add new user in system net user to list all user net user username  space *  To change password   if you not make any password then double enter type nul...