Home  >  Q&A  >  body text

php-laravel - Several php laravel issues

1.

abort(404, 'Unauthorized action.');

An error will be thrown, showing 404.blade.php view file. How should I output Unauthorized action.?

in this view file?

2.
How to get the name of the currently executed controller and method?
Use
echo Route::currentRouteAction();# in the controller

##The result is an error:


3.
Route::controllers(['test' => 'TestController']);

Do I have to set the get/post/etc. method for each method in the controller to set the routing in this way?

4.
<?php echo url('/login');?>

The url will be output, but I am using https, how should I set it up?

5.Where to put the custom function? See what is written in this article.
composer dump-autoload, maybe sometimes there is only FRP but no SSH permissions. What else? Any solution?http://laravel.so/tricks/e81a15277236d35feb19ad5b86427bdc

PHPzPHPz2735 days ago789

reply all(2)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 16:57:16

    1. Please see http://laravel.so/tricks/9024b7536d8275d9eba8b4b945840c03

    2. Please see http://overtrue.me/articles/2015/03/get-current-controller-of-laravel.html

    3. is

    4. asset() Helper function

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-16 16:57:16

    1. The upstairs looks nice

    2. use Route;

    3. Yeah

    4. Upstairs

    Finally, if you are interested, you can check out the series of videos I recently recorded on Laravel 5.1

    https://laravist.com/series/laravel-5-basic

    reply
    0
  • Cancelreply