retrieve single row in LARAVELusing eloquent

i am using laravel 5.1 and want to retrieve a single row in the database then manipulate it after. my current code is $profiles = Profile::where(‘user_id’, $this->user->user_id) ->where(‘…

Laravel :: Best way to update a foreign key

I have this migration file Schema::create(‘table_one’, function(Blueprint $table) { $table->increments(‘id’); $table->string(‘name’); $table->integer(‘table_two_id’)->…

find in set in laravel ? example

I am new in laravel. My query is i need to find out value from comma separated field. Here is my table: tags_value ╔════╦══════════════╗ ║ id ║ tags ║ ╠════╬══════════════╣ ║ 1 ║ css,html,…

Laravel 5 console (artisan) command unit tests

I am migrating my Laravel 4.2 app to 5.1 (starting with 5.0) and am a lot of trouble with my console command unit tests. I have artisan commands for which I need to test the produced console output, …

Laravel : App::setLocale doesn’t work

I’m using laravel 5.1, I’m trying to update locale in app file like this : In Locale Middleware file : … public function handle($request, Closure $next) { if(Session::has(‘locale’…

upload_max_filesize doesn’t change within Laravel 5.1

I’m working on multiple file upload while that time I’ve got an error The file “theOne.mp3” exceeds your upload_max_filesize ini directive (limit is 2048 KiB). So after that I’ve increased the …

Update table structure without rollback in Laravel 5.1

I am beginner in Laravel. I use migrate to create tables in a database, but I don’t want to migrate:rollback to update my table. I want to apply changes in my old database without loosing current …

How to execute raw queries with Laravel 5.1?

So I have this tiny query to run on my DB and it works fine in MySQL Workbench. Basically, a SELECT with LEFT JOIN and UNION with LEFT JOIN again. SELECT cards.id_card, cards.hash_card, …

Laravel Homestead Swift Cannot send message without a sender address

I get this error with stock email settings in Laravel 5.1 Homestead when I try to send a password reset mail. Swift_TransportException in AbstractSmtpTransport.php line 162:Cannot send message …