×
Clear all filters including search bar
Valeri Tandilashvili's Personal Professional Blog
btn-lg
<button type="button" class="btn btn-primary btn-lg">Large primary</button>
<button type="button" class="btn btn-secondary btn-lg">Large secondary</button>
Medium buttons with no special class because it's default<button type="button" class="btn btn-primary">Default primary</button>
<button type="button" class="btn btn-secondary">Default secondary</button>
Small buttons with class btn-sm
<button type="button" class="btn btn-primary">Small primary</button>
<button type="button" class="btn btn-secondary btn-sm">Small secondary</button>
delete
and edit
links@if (!Auth::guest())
@if (Auth::user()->id == $post->user_id)
<!-- delete and edit links -->
@endif
@endif
Post
modelpublic function user() {
return $this->belongsTo('App\User');
}
Inside User
modelpublic function posts() {
return $this->hasMany('App\Post');
}
@guest
<!-- Authentication Links for Guests -->
@else
<!-- HTML for Authenticated Users -->
@endgues
Auth::routes();
created_at
with descending
order, to see the newly created posts at the top php artisan route:list
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->mediumText('content');
$table->timestamps();
});
$table->id()
- creates bigint(20)
unsigned auto-increment field
$table->string('title')
- creates varchar(255)
utf8mb4_unicode_ci field
$table->mediumText('content')
- creates mediumtext
utf8mb4_unicode_ci field
$table->timestamps()
- creates created_at
and updated_at
timestamps.env
file contains database config information that needs to be changed
to use the databaseDB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=lara4db
DB_USERNAME=root
DB_PASSWORD=
ctrl + p
-> search ext install laravel blade
-> install laravel blade snippets
extension