Skip to main content

Migration for voyager created database

composer require --dev "xethron/migrations-generator"

Way\Generators\GeneratorsServiceProvider::class,
Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class,


To generate migrations from a database, you need to have your database setup in Laravel's Config.
Run php artisan migrate:generate to create migrations for all the tables, or you can specify the tables you wish to generate using php artisan migrate:generate table1,table2,table3,table4,table5. You can also ignore tables with --ignore="table3,table4,table5"
Laravel Migrations Generator will first generate all the tables, columns and indexes, and afterwards setup all the foreign key constraints. So make sure you include all the tables listed in the foreign keys so that they are present when the foreign keys are created.
You can also specify the connection name if you are not using your default connection with --connection="connection_name"
Run php artisan help migrate:generate for a list of options.
Check out Chung Tran's blog post for a quick step by step introduction: Generate Migrations from an existing database in Laravel 4

Comments

Popular posts from this blog

Installing Admin LTE in Laravel

step 1:  Reference---  https://hdtuto.com/article/laravel-56-adminlte-bootstrap-theme-installation-example Step 2 : after completion first reference view this link:    https://github.com/JeroenNoten/Laravel-AdminLTE step 3:  For more additional information view this link:   https://github.com/jeroennoten/Laravel-AdminLTE#2-updating Now you are done statically : https://adminlte.io/blog/integrate-adminlte-with-laravel Steps: 1:  composer require jeroennoten/laravel-adminlte 2: 'providers' => [ .... JeroenNoten\LaravelAdminLte\ServiceProvider::class, ], 3: php artisan vendor:publish --provider="JeroenNoten\LaravelAdminLte\ServiceProvider" --tag=assets 5: php artisan vendor:publish --provider="JeroenNoten\LaravelAdminLte\ServiceProvider" --tag=config 6: php artisan vendor:publish --provider="JeroenNoten\LaravelAdminLte\ServiceProvider" --tag=views 7: for admin pannel php artisan ...

Integration of adminlte admin pannel in laravel 6 adn above

Create new laravel project : laravel new projectname --auth Steps to integrate admin pannel i.e. adminlte 1.  composer require jeroennoten/laravel-adminlte 2.  php artisan adminlte:install 3.  php artisan adminlte:install --only=auth_views 4. php artisan vendor:publish --provider="JeroenNoten\LaravelAdminLte\AdminLteServiceProvider" --tag=views Filemanager: https://unisharp.github.io/laravel-filemanager/installation 1.  composer require unisharp/laravel-filemanager:~1.8 php artisan vendor:publish --tag = lfm_config php artisan vendor:publish --tag = lfm_public 3.  php artisan route:clear php artisan config:clear you will get a problem regarding file relode after upload and to solve do this fix it on vendor\unisharp\laravel-filemanager\src\Controllers\UploadController.php replace line 60 return count($this->errors) > 0 ? $this->errors : parent::$success_response; by return count($this->errors) > 0 ? ...

Setting and Getting Cookie and Session in laravel

First of all lets discuss many ways to set cookies inside controller : $response = new Response ( redirect ( 'news' )); //$minute=5; // $response->withCookie(cookie('name', 'virat', $minutes)); $response -> withCookie ( cookie ()-> forever ( 'news_id' , $newsid )); return $response ; // or // Cookie::queue('news_id', $news_id, 15); // return redirect('news'); // or // return redirect('news')->withCookie(cookie('name', 'virat', $minutes)); use Illuminate\Support\Facades\ Request ; use Illuminate\Http\ Response ; use Illuminate\Support\Facades\ Cookie ; To get cookies: inside controller $val = Request :: cookie ( 'news_id' ); // dd($val); $v = Cookie :: get ( 'news_id' ); // dd($v); or $value = $request -> cookie ( 'name' ); in blade: {{ Cookie :: get ( 'news_id' ) }} Now lets see for session: Ref...