find in set in laravel ? example

You need to escape the call to FIND_IN_SET() using quotes: $query = DB::table(‘tags_value’) ->whereRaw(‘FIND_IN_SET(“css”, Tags)’) ->get(); But unless it’s a fixed value, you should always parameterize the column for which you search in FIND_IN_SET: $searchvalue=”css”; $query = DB::table(‘tags_value’) ->whereRaw(‘FIND_IN_SET(?, Tags)’, [$searchvalue]) ->get();

Symfony\Component\HttpKernel\Exception\NotFoundHttpException Laravel

A NotFoundHttpException exception in Laravel always means that it was not able to find a router for a particular URL. And in your case this is probably a problem in your web server configuration, virtual host (site) configuratio, or .htaccess configuration. Your public/.htaccess should look like this: <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine … Read more

Laravel /broadcasting/auth Always Fails With 403 Error

Error 403 /broadcasting/auth with Laravel version > 5.3 & Pusher, you need to change your code in resources/assets/js/bootstrap.js with window.Echo = new Echo({ broadcaster: ‘pusher’, key: ‘your key’, cluster: ‘your cluster’, encrypted: true, auth: { headers: { Authorization: ‘Bearer ‘ + YourTokenLogin }, }, }); And in app/Providers/BroadcastServiceProvider.php, replace Broadcast::routes() with Broadcast::routes([‘middleware’ => [‘auth:api’]]); or … Read more

Unit Test Laravel’s FormRequest

I found a good solution on Laracast and added some customization to the mix. The Code /** * Test first_name validation rules * * @return void */ public function test_valid_first_name() { $this->assertTrue($this->validateField(‘first_name’, ‘jon’)); $this->assertTrue($this->validateField(‘first_name’, ‘jo’)); $this->assertFalse($this->validateField(‘first_name’, ‘j’)); $this->assertFalse($this->validateField(‘first_name’, ”)); $this->assertFalse($this->validateField(‘first_name’, ‘1’)); $this->assertFalse($this->validateField(‘first_name’, ‘jon1’)); } /** * Check a field and value against validation rule * … Read more

Laravel quick start guide route not working

Seems like your Laravel app is accesible via an Apache HTTP alias, because your URL looks like: http://localhost/laravel/. If this is the case and assuming that http://localhost/laravel is pointing to your public directory, then follow these steps: Try to navigate to your expected route prepend it with /index.php/, in your case: http://localhost/laravel/index.php/users. If it works … Read more