Results: 71
Sets table name for the model (default is lowercase plural form, in this case
posts
)
class Post extends Model
{
    // Table Name
    protected $table = 't_posts';
}
Shows count of posts
echo App\Post::count();
Creates new post in
posts
table using tinker from terminal
$post = new App\Post();
$post->title = 'the post title';
$post->content = 'the post body';
$post->save();
Deletes the newly created post
$post->delete();
Activates database eloquent mode in terminal
php artisan tinker
php artisan serve
Creates local server to serve the Laravel application (must be run in the root folder of the project)
php artisan serve
npm run watch
Waits for changes and then recompiles again
npm run watch
npm run dev
Compiles assets
npm run dev
Imports CSS asset from
public/css/
folder
<link href="{{asset('css/app.css')}}" rel="stylesheet">
Pass parameter from controller to view
public function about() {
        $param1 = 'this is a parameter of about us page';
        return view('pages/about', compact('param1'));
    }
Content of
about
blade (the page receives and uses the passed parameter)
@section('cntnt')
    <h3>abt us {{$param1}}</h3>
@endsection
@extends
Extends layout file located at
resurces/views/layouts/app.blade.php
@extends('layouts.app')

@section('content')
     // "about us" page content goes here
@endsection
@yield
is mainly used to define a section in a layout. Content of
resources/views/layouts/app.blade.php
file
<body>
     @yield('content')
</body>
Content of
about
page that extends the above layout file
@extends('layouts.app')

@section('content')
     // "about us" page content goes here
@endsection
Results: 71