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.


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 I wanted to use sqlite in heroku so I need to add the sqlite driver in composer.json then run 'composer update'.
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 For the controller make sure you have added ->setCallback($request->input('callback')) at the end of the json response.
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. It might take a little while to compile and install. After compilation is done, it’ll give you some instructions to finish setting it up. The database will be initialized during installation, so there isn’t a need to run initdb to finish installation of Postgres via Homebrew. Near the end of the installation instructions you should see mention of the command brew services. If you don’t already have brew services installed. It may be installed with this command: brew services stop/start postgresql createuser -s postgres download pgAdmin https://www.postgresql.org/ftp/pgadmin/pgadmin4/v2.0/macos/
Share:

Wednesday, 2 May 2018

Complex Laravel Eloquent Example

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 It will give you a type array of objects in which you can display with -> command. The return set will be like this If you're using a json_decode with FALSE parameter on eloquent object It will give you a type array of objects in which you can display with -> command. The return set will be like this If you're using a ->toArray on eloquent object It will give you a type array with keys and values in which you can display with $currency['s_name']. The return set will be like this If you're using a json_decode with TRUE parameter on eloquent object It will give you a type array with keys and value in which you can display with $currency['s_name'] command. The return set will be like this Various ways to play with the return set of DB:RAW
Share:

Monday, 12 March 2018

Laravel Seeding Example with Faker library

Install faker from https://github.com/fzaninotto/Faker From the command line
Share:

Popular Posts

Recent Posts

Pages

Powered by Blogger.