Results: 1578
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
npm run watch
Waits for changes and then recompiles again
npm run watch
by Valeri Tandilashvili
5 years ago
0
Laravel
npm commands
0
php artisan serve
Creates local server to serve the Laravel application (must be run in the root folder of the project)
php artisan serve
by Valeri Tandilashvili
5 years ago
0
Laravel
artisan commands
0
Activates database eloquent mode in terminal
php artisan tinker
by Valeri Tandilashvili
5 years ago
0
Laravel
artisan commands
Laravel From Scratch
0
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();
by Valeri Tandilashvili
5 years ago
0
Laravel
tinker commands
Laravel From Scratch
0
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';
}
by Valeri Tandilashvili
5 years ago
0
Laravel
models
Laravel From Scratch
0
Sets primary key for the model (default is
id
)
class Post extends Model
{
    // Primary key
    public $primaryKey = 'record_id';
}
by Valeri Tandilashvili
5 years ago
0
Laravel
models
Laravel From Scratch
0
Sets timestamps to false (default is
true
)
class Post extends Model
{
    // Timestamps
    public $timestamps = false;
}
by Valeri Tandilashvili
5 years ago
0
Laravel
models
Laravel From Scratch
0
Lists all records of the model
$posts = Post::All();
return view('posts.index')->with('posts', $posts);
by Valeri Tandilashvili
5 years ago
0
Laravel
model methods
Laravel From Scratch
0
Lists all records of the model ordered by
title
descending
$posts = Post::orderBy('title', 'asc')->get();
return view('posts.index')->with('posts', $posts);
by Valeri Tandilashvili
5 years ago
0
Laravel
model methods
Laravel From Scratch
0
Filters result using the
where
method
public function index()
{
    $posts = Post::where('title', 'pst')->get();
    return view('posts.index')->with('posts', $posts);
}
by Valeri Tandilashvili
5 years ago
0
Laravel
model methods
Laravel From Scratch
0
Results: 1578