Showing posts with label Laravel 5.3. Show all posts
Showing posts with label Laravel 5.3. Show all posts

Tuesday, January 2, 2018

Drop Table Index in Laravel 5.3

Before deleting index :
Result :

see the previous post about adding index...

Create Composite Index in Lavel 5.x

Create migration first ...

Edit our migration file like this :
Executing migration file :
Doneee...


For deleting index. Please see this post...

Tuesday, May 9, 2017

Wednesday, April 12, 2017

Viewing Messages & Session in Laravel 5.3

Here is my sample code :

If we run it on laravel 5.3, then we can get something like this :


Tuesday, April 11, 2017

Sending Email Using Queue (SMTP-GMAIL) in Laravel 5.3 - Part I

In previous post, we have successfully sent an email using Mail::send with some of it's properties and we sent this email using default way or not using background worker or in another word 'queue'. So Right now, we are going to play queue to the email using smtp-gmail :D. mmmm......... Next please follow below instructions
1. Create table for queue and also failed-table too. Queue table is for saving list of some jobs (emails that will be sent) and failed-table is for saving failed list of our emails. For creating those tables, we can use these commands :
php artisan queue:table
php artisan queue:failed-table
So we have two migration files now :
Next, execute migration command:
php artisan migrate
Aaand now we have two tables in our phpmyadmin :
2. Change QUEUE_DRIVER = sync to database on .env file :

3. Create new job :
php artisan make:job {your-job-file-name}

4. Let's create a new route and controller...
5. Actually, we can do this step in step 3, buuut... mmmm.... yaaah... it's okie to seperate it in another step... :D
So... in this step 5, let's complete our handle method :




6. Run php artisan queue:listen
This command is the starting point for our queue job to be executed by laravel.

Tuesday, March 14, 2017

'stream_socket_enable_crypto(): ssl3_get_server_certificate:certificate verify failed' on Laravel 5.3

Here's the error message :
`'stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed', `

I just changed the MAIL_DRIVER from smtp to mail on my laravel env file


MAIL_DRIVER=mail
MAIL_HOST=hyosoka.host.co
MAIL_PORT=587
MAIL_USERNAME=hyosokateam
MAIL_PASSWORD=pass
MAIL_ENCRYPTION=tls
MAIL_DOMAIN='@mail.test.hyosoka.co'

If the problem still persist and if you are using windows, sometimes please disable your antivirus. Because sometimes antivirus is blocking your windows port. Or change the MAIL_PORT to another port, for example 2578, 2525, etc

Tuesday, November 1, 2016

$_SERVER content in Laravel 5.3



Test basename in Laravel 5.3



parse_url in laravel




is_null and empty in laravel 5.3

So I have an empty table here :
Let's see the first output of this code :
So if we use ::find(), then variabel will pass both empty and null checker....Next how about this one :
Result :
Naaah... as we can see, if we use ::select then variabel is not empty or null... :v
buuut... let's see what happens if we check $empty->name,
Result :
We can't use $empty->name for is_null, so :
Sooo... if we just check $empty, then it won't be empty, but if we use $empty->name, it will be an empty .... yaaapss... Next code :
Again, we can't use $empty->name, so just comment it on.....aaaand... the output is like this :
So if we use ->first(), it will be an empty and null... but how about ->get();
So ->get() will fail at is_null... :D.. Then it will be safe if we use empty($var) instead of using is_null.... Ok... the last :
Like we got from get() before, is_null can't be applied, but if we change it to use ->first(), then :












Saturday, October 29, 2016

Import and Run Laravel Project in Eclipse PDT




Okie... Next thing we have to do is configuring laravel new server....So go to "Run" menu, choose "Run Configuration" :
Hit "New" to create a new configuration


Just hit "Finish"... okaay... mmmm.mmmmmmm............Next, right-click on welcome.blade.php, then run as webapplication :


Oooops.... We need to run "php artisan serve" from cmd then... :D
 Refresh the page.... aaaand... tadaaa....