Tuesday, 18 September 2018

Laravel Filtering Eloquent Results and Left Join Example

These scripts join table demographics to countries table by looking into line 2. Line 7 to 18 shows how can we filter the resulted collection on the results. Finally, this returns an array of demographics with age, gender, and location as indexes. $mixDemographics =DB::table('demographics') ...
Share:

Tuesday, 17 July 2018

Webpush notifications for Laravel

Here the necessary steps in creating a webpush applications in LARAVEL. Add the library in your composer by checking this site. In order for you to run this site, you must enforce https on your website by adding this line in you AppServiceProvider.php public function boot() { $this->app['request']->server->set('HTTPS', true); } I wanted to use sqlite in heroku...
Share:

Monday, 16 July 2018

Return JSON from a Laravel server from a different domain using javascript

Been tinkering for 3 hours how to get the things going. For the javascript side In web.php add the route name('postPricing'); ]]> For the controller make sure you have added ->setCallback($request->input('callback')) at the end of the json response. ![CDATA[ public function postPricing(Request $request){ $pricing = []; $sliderValue = 0; for ($x = 1;...
Share:

Monday, 9 July 2018

Complete Postgres installation step by step

Homebrew is a popular package manager for OS X. To install Postgres with Homebrew, follow the steps below: The first thing to do is install Homebrew if you haven’t done so already. Homebrew site has a simple command that you have to paste in your terminal to do so. Make sure to accept the command line developer tools installation if prompted. Next, run brew install postgres to install Postgres....
Share:

Wednesday, 2 May 2018

Complex Laravel Eloquent Example

select n0y_t_item_description.s_title, n0y_t_item_description.s_slug as item_slug, n0y_t_item.d_price as price, n0y_t_category_description.s_name, n0y_t_category_description.s_slug as category_slug, n0y_t_item_resource.pk_i_id as path_id, n0y_t_item_resource.s_path as image_path, n0y_t_item_resource.s_extension as path_ext, parent_slug from `n0y_t_item` inner join `n0y_t_item_description`...
Share:

Saturday, 21 April 2018

Understanding Laravel Return set

Difference between Laravel Eloquent, DB Raw, Json Encode and Json Decode result set. If you're using a DB:select raw command $currencyRaw = DB::select( DB::raw('select * from currency)); It will give you a type array of objects in which you can display with -> command. The return set will be like this array ( 0 => stdClass::__set_state(array( 'pk_c_code' => 'EUR', ...
Share:

Monday, 12 March 2018

Laravel Seeding Example with Faker library

Install faker from https://github.com/fzaninotto/Faker composer require fzaninotto/faker From the command line php artisan make:seeder UsersTableSeeder use Illuminate\Database\Seeder; class DatabaseSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { $this->call(UsersTableSeeder::class); } } use...
Share:

Popular Posts

Recent Posts

Pages

Powered by Blogger.

About Me

My photo
For the past 10 years, I've been playing with codes using PHP, Java, Rails. I do this for a living and love new things to learn and the challenges that comes with it. Besides programming I love spending time with friends and family and can often be found together catching the latest movie or planning a trip to someplace I've never been before.