This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer create-project --prefer-dist laravel/laravel:^7.0 laravel-eloquent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer require laravel/ui:^2.4 | |
composer require laravel/telescope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Run this command in the root directory of the project installed using composer | |
//This command adds ui scaffoldings for the application | |
php artisan ui bootstrap | |
//This commands sets up the ui to use bootstrap for authentication | |
php artisan ui bootstrap --auth | |
//This commands install node dependencies and compiles frontend assets for laravel default auth functionalities | |
npm install && npm run dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
//Add the schema facade | |
use Illuminate\Support\Facades\Schema; | |
class AppServiceProvider extends ServiceProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//These commands generates models and their respective migration files | |
php artisan make:model Post -m | |
php artisan make:model Profile -m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Schema::create('posts', function (Blueprint $table) { | |
$table->id(); | |
$table->unsignedBigInteger('user_id'); | |
$table->foreign('user_id')->references('id')->on('users'); | |
//It can be done like this as well in a more simplified way | |
//$table->foreignId('user_id')->constrained(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
class CreatePostsTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
class CreateProfilesTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* User | |
* | |
* @author Obua Emmanuel <eobua6882@gmail.com> | |
* @copyright 2021 Obua Emmanuel | |
* @link http://emmanuelobua.me | |
* @version 1.0.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ProfileController | |
* | |
* @author Obua Emmanuel <eobua6882@gmail.com> | |
* @copyright 2021 Obua Emmanuel | |
* @link http://www.emmanuelobua.me | |
* @version 1.0.0 | |
* |
OlderNewer