Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.

tjcasner

Professional Athlete at MLS / USL

Experience

18,960

0 Best Reply Awards

  • Member Since 7 Months Ago
  • 189 Lessons Completed
  • 1 Favorite

13th June, 2017

tjcasner left a reply on Use The Same Login Form For Multiple Account Login • 6 months ago

Looks like you need some sort of roles/permissions tables within your database to differentiate between administrators and students.

Jeffrey has a couple of great lessons on this starting here:

https://laracasts.com/series/whats-new-in-laravel-5-1/episodes/13

Also check out the Gate component of the docs:

https://laravel.com/docs/5.4/authorization#gates

This is a robust way that your backend will sort out where your users are redirected.

12th June, 2017

tjcasner left a reply on How To Add In A New Library To Laravel Using Composer? • 6 months ago

Composer does all the work for you by creating a sproutvideo directory inside your vendor directory where the files are downloaded and stored.

tjcasner left a reply on How To Add In A New Library To Laravel Using Composer? • 6 months ago

Just add "sproutvideo/sproutvideo": "1.1.0" to your required dependencies in Laravel's composer.json file.

From there run composer update and it will automatically pull in the files to your vendor directory under vendor/sproutvideo.

10th June, 2017

tjcasner left a reply on A_guest_can_see_nothing_but_login • 6 months ago

The 'make:auth' command creates an auth middleware to separate guests from authenticated users. You can apply it to your routes as a group or individually.

https://laravel.com/docs/5.4/middleware#assigning-middleware-to-routes

Route::get('/home', function () {
    //
})->middleware('auth');

or:

public function __construct()
    {
        $this->middleware('auth');
    }

add this to all of your controllers which will automatically protect all of your views that require authentication

tjcasner left a reply on A_guest_can_see_nothing_but_login • 6 months ago

Assuming you haven't yet run 'make:auth', the simplest way to protect the rest of your routes would be (in my opinion) to use Laravel's built in Gate facade.

https://laravel.com/docs/5.4/authorization#gates

Using Gate, you can write a closure within the AuthServiceProvider file to check if the user is a guest in your system and protect all of your routes in one conditional.

Hope this helps!

9th June, 2017

tjcasner left a reply on Login And Home On Same Url ('/' ) • 6 months ago

If you look at the routes/web.php file within your application, you'll notice that Laravel provides an initial route:

Route::get('/', function () {

    return view('welcome');

});

This tells Laravel to show the welcome view (resources/views/welcome.blade.php) when when routing to '/'. Simply return the view that contains your authentication logic when routing to the desired url '/'.

Route::get('/', function () {

    return view('your-login-view-here');

});

Furthermore, you can use a controller or conditional logic within your route to return different views on the same url based on a user's authentication status. For example:

Route::get('/', function () {
    if (Auth::guest()) {
        return view('login'); // login page on '/'
    } else {
        return view('home'); // authenticated page on '/'
    }
});
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.