Skip to content
Advertisement

Tag: laravel-5

Laravel 5 Eloquent appending relationships to JSON on multiple levels

So it is pretty easy to include relationships on models such as: when there’s a get request to the user resource, it will include associated roles automagically. But in this setup, the role resources returned with user resource also includes it’s own included relationships like: This generates huge objects, that mostly include unnecessary related child models. I can workaround this

Laravel 5 and PHPMailer

Does anybody have a working example how I can work with PHPMailer in Laravel 5? In Laravel 4 it was quiet simple to use but the same method doesn’t work in L5. Here it is what I did in L4: Added in …

How to register console command from package in Laravel 5?

Since Laravel 5, it is interest to me – how to register and use console command from package in Laravel 5. As in laracast discuss https://laracasts.com/discuss/channels/tips/developing-your-packages-in-laravel-5, i create a directory structure, add my package to autoload and create a service provider My InstallCommand.php script stored in /src/Console I register service provider in app.php & execute dump-autoload. But when i try

List all registered variables inside a Laravel view

I am using Laravel 5. I would like to know which are all variables passed to a view inside the view itself. Since all variables are in the view scope I thought I could use the generic PHP function: get_defined_vars(); http://php.net/manual/en/function.get-defined-vars.php Something like this: But I would like to know if there is a better way (something like View::getData()) Note:

Laravel 5 input old is empty

My routes is here Controller And View The {{old()}} function return empty value. EDIT I took Answer Your problem looks like you are not actually submitting the username in the first place: There is no ‘submit’ button inside the form. If you submit outside the form – then the username will not be included. Add the submit button inside your

Advertisement