Asked  2 Years ago    Answers:  5   Viewed   101 times

Recently I start to use laravel 5.3 to write a blog, but I have a question after run php artisan make:auth

when I run this, it will generate routes in my web.php

this is the code in it:

Auth::routes();

Route::get('/home', '[email protected]');

Then I run php artisan route:list, I find lots of actions, like [email protected]

But I didn't find these actions in my AppHttpControllersAuth, where are these?

And also what is the Auth::routes() stand for, I can't find the routes about Auth.

I need someone help, thank you to answer my question

 Answers

3

Auth::routes() is just a helper class that helps you generate all the routes required for user authentication. You can browse the code here https://github.com/laravel/framework/blob/5.3/src/Illuminate/Routing/Router.php instead.

Here are the routes

// Authentication Routes...
$this->get('login', '[email protected]')->name('login');
$this->post('login', '[email protected]');
$this->post('logout', '[email protected]')->name('logout');

// Registration Routes...
$this->get('register', '[email protected]')->name('register');
$this->post('register', '[email protected]');

// Password Reset Routes...
$this->get('password/reset', '[email protected]');
$this->post('password/email', '[email protected]');
$this->get('password/reset/{token}', '[email protected]');
$this->post('password/reset', '[email protected]');
Sunday, September 4, 2022
2

Haven't tried that, but in general array fields you usually write like this: program.*, so maybe something like this will work:

  $validator = Validator::make($request->all(),[
        'program'           => 'required',
        'music_instrument'  => 'required_if:program.*,in:Music'
  ]);

If it won't work, obviously you can do it also in the other way for example like this:

$rules = ['program' => 'required'];

if (in_array('Music', $request->input('program', []))) {
    $rules['music_instrument'] = 'required';
}

$validator = Validator::make($request->all(), $rules);
Monday, August 15, 2022
2

Change your blade.php

<div class="md-card-content">
            <div class="uk-float-right uk-margin-small-right"><span class="uk-text-medium uk-text-center">{{ $samples[0]['COUNT'] }}</span></div>
            <span class="uk-text-muted uk-text-medium">2017 YTD</span>
            <div class="clearfix"></div>
            <div class="clearfix"></div>
            <hr />
            <div class="uk-float-right uk-margin-small-right"><span class="uk-text-medium uk-text-center">{{ $samples[1]['COUNT'] }}</span></div>
            <span class="uk-text-muted uk-text-medium">2018 YTD</span>
            <div class="clearfix"></div>
            <div class="clearfix"></div>
            <hr />
            <div class="uk-float-right uk-margin-small-right"><span class="uk-text-medium uk-text-center">{{ $samples[2]['COUNT'] }}</span></div>
            <span class="uk-text-muted uk-text-medium">2017 Full Year</span>
            <div class="clearfix"></div>
            <div class="clearfix"></div>
            <hr />

</div>
Saturday, November 5, 2022
 
1

Just define a unique rule on your users table:

public static $rules = array(
    'email' => 'required|unique:users|email');
Friday, August 5, 2022
5

you can try with the required_without.

$rules = array(
   'billable_option' => 'required_without:billable_option_yes',
   'billable_option_yes' => 'required_without:billable_option'
);
Wednesday, September 7, 2022
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 

Browse Other Code Languages