Press enter to see results or esc to cancel.

Abraham Garcia Abraham Garcia in PHP Scripts   Thursday, June 10 2021

How to Remove a Migration in Laravel

I wanted to delete a laravel migration because I named it incorrectly so I had to follow the steps to rollback.

I found this article on StackOverflow that showed me what to do to delete a migration I accidentally created a migration with a bad name (command: php artisan migrate:make). I did not run (php artisan migrate) the migration, so I

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, June 8 2021

Get the Last Inserted ID Laravel

Get Laravel Insert Statement ID Row. Simple 4 Methods to follow.

These are short code snippets on how to get your last inserted ID on Laravel.  1) Using the insertGetId() method $id = DB::table('users')->insertGetId( [ 'name' => 'first' ] ); dd($id); 2) Using the lastInsertId()

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Monday, June 7 2021

Laravel Admin LTE Custom Master Blade PHP File

Laravel AdminLTE Custom Master Blade inside Views

In order to create a master blade outside of the vendor folder, you would create a new folder inside the views follow these steps Duplicate files into views/vendor/adminlte/master.blade.php That is all you need to get your master blade outside of

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Thursday, April 22 2021

How To Do a Get Request on Laravel

Use the HTTP Helper in Laravel to Perform GET requests. This example also includes a Bearer Token Request.

In order to do a GET request on Laravel you can use the HTTP Request Helper.  Include this in your header to use the helper.  use IlluminateHttpRequest; Then you can request your get URL here we also have a  bearer token we are

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, April 13 2021

How to get AdminLTE Installed on Laravel Quickly

Simple Admin Template for Laravel Get Started in a Couple of Seconds

I was looking for an admin template for a small Laravel project I am starting and I found that there is a repo for AdminLTE on Laravel that makes the development super easy and it is super easy to install just follow the instructions to get

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Thursday, March 25 2021

How to share data across all Laravel Views

Share you Data Across all Laravel Views in One Simple File Modification.

If you wanted to share data across your different views in Laravel and I found this quick way to do it.  In your Providers/AppServiceProvider.php in the boot() function insert the following to share data across all views. 

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, January 12 2021

How to Delete Image File on Laravel Storage?

Delete your Image stored in storage in Laravel

To delete image from storage on laravel in your controller make sure to include use Illuminate\Support\Facades\Storage; within your function use this code to delete the image Storage::delete($post->image);  

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Monday, January 4 2021

How to Create a Trashed Entry on Laravel

I was looking at the documentation for laravel as I am learning this framework. One cool thing I saw is how to modify the database for trashed elements. Here are the steps to get started

I was looking at the documentation for laravel as I am learning this framework. One cool thing I saw is how to modify the database for trashed elements. Here are the steps to get started First, we must run a command to create the migration table for

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, December 29 2020

How to Create Shortcodes on WordPress Functions File

Create Easy Shortcodes for your WordPress Website. Modify your functions.php with the following snippet and get rolling.

This is a snippet you can use when creating your shortcodes for WordPress. It makes it easy for you to reuse any of your functions // Function to add subscribe text to posts and pages function subscribe_link_shortcode() { return 'If you

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, December 22 2020

Laravel htaccess on MAMP Remove the Public Folder Route

Remove the Public route on the Laravel Project when working in MAMP without the virtual host setup.

Laravel htaccess Code to remove the /public route from your projects on MAMP and any other environments that you cannot setup or do not want to setup virtual environments.  <IfModule mod_rewrite.c> <IfModule mod_negotiation.c>

Continue reading