Results: 1578
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
Button types with html examples
<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-secondary">Secondary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-light">Light</button>
<button type="button" class="btn btn-dark">Dark</button>

<button type="button" class="btn btn-link">Link</button>
Special classes for different button types:
btn-primary
btn-secondary
btn-success
btn-danger
btn-warning
btn-info
btn-light
btn-dark
by Valeri Tandilashvili
5 years ago
0
Bootstrap
buttons
Bootstrap official doc
0
100%
Extra small <576px
540px
Small ≥576px
720px
Medium ≥768px
960px
Large ≥992px
1140px
Extra large ≥1200px
by Valeri Tandilashvili
5 years ago
0
Bootstrap
layout
Bootstrap official doc
1
xs
Extra small
<576px
sm
Small
≥576px
md
Medium
≥768px
lg
Large
≥992px
xl
Extra large
≥1200px
by Valeri Tandilashvili
5 years ago
0
Bootstrap
layout
Bootstrap official doc
1
git commit amend
change commit name or add some changes in previous commit
git commit -amend -m "comment"
by Luka Tatarishvili
5 years ago
0
Git
commands
Git Tutorials
0
Only the post author will be able to see
delete
and
edit
links
@if (!Auth::guest())
    @if (Auth::user()->id == $post->user_id)
        <!-- delete and edit links -->
    @endif
@endif
by Valeri Tandilashvili
5 years ago
0
Laravel
auth
Laravel From Scratch
1
Adds exceptions so that unauthorized users will be able to see all posts and individual post
public function __construct() {
    $this->middleware('auth', ['except'=>['index', 'show']]);
}
by Valeri Tandilashvili
5 years ago
0
Laravel
auth
Laravel From Scratch
0
Only the post author will be able to delete their own post
public function destroy($id)
{
    $post = POST::find($id);

    // Check for correct user
    if (auth()->user()->id !== $post->user_id) {
        return redirect('/posts')->with('error', 'Unauthorized page');
    }

    $post->delete();
    return view('posts')->with('success', 'Post Removed');
}
by Valeri Tandilashvili
5 years ago
0
Laravel
auth
Laravel From Scratch
2
Only the post author will be able to edit the post
public function edit($id)
{
    $post = POST::find($id);

    // Check for correct user
    if (auth()->user()->id !== $post->user_id) {
        return redirect('/posts')->with('error', 'Unauthorized page');
    }

    return view('posts.edit')->with('post', $post);
}
by Valeri Tandilashvili
5 years ago
0
Laravel
auth
Laravel From Scratch
0
Lists logged in user's posts on dashboard
$user_id = auth()->user()->id;
$user = User::find($user_id);
return view('dashboard')->with('posts', $user->posts);
by Valeri Tandilashvili
5 years ago
0
Laravel
models
Laravel From Scratch
3
Inside
Post
model
public function user() {
    return $this->belongsTo('App\User');
}
Inside
User
model
public function posts() {
    return $this->hasMany('App\Post');
}
by Valeri Tandilashvili
5 years ago
0
Laravel
relationships
Laravel From Scratch
1
Results: 1578