HOW TO: Install Memcache on XAMPP (Windows 7/8/10)

Here are the steps that should be followed when you install memcache. Start your xampp. Click on ‘config’ and open php.ini file. search for ;extension=php_memcache.dll If not found add extension=php_memcache.dll [Memcache] memcache.allow_failover = 1 memcache.max_failover_attempts=20 memcache.chunk_size =8192 memcache.default_port = 11211 Download the file php_memcache.dll from windows.php.net (make sure to check your php version and php_memcache.dll … Read more

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();

Laravel 5 get view name

Update your AppServiceProvider by adding a view composer to the boot method and using ‘*’ to share it with all views: <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { view()->composer(‘*’, function($view){ $view_name = str_replace(‘.’, ‘-‘, $view->getName()); view()->share(‘view_name’, $view_name); … 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

Modify existing Authorization module (email to username)

Laravel search the variable $username in the file : Illuminate\Foundation\Auth\AuthenticatesUsers public function loginUsername() { return property_exists($this, ‘username’) ? $this->username : ’email’; } As you can see, by default it will be named as ’email’. However you can override it in your AuthController by adding : protected $username=”username”;

Error 405 (Method Not Allowed) Laravel 5

The methodNotAllowed exception indicates that a route doesn’t exist for the HTTP method you are requesting. Your form is set up to make a DELETE request, so your route needs to use Route::delete() to receive this. Route::delete(’empresas/eliminar/{id}’, [ ‘as’ => ‘companiesDelete’, ‘uses’ => ‘CompaniesController@delete’ ]);