Skip to main content

Posts

get data from storage folder after link

  {{ asset ( 'storage/videos/video_1721131211471284370.mp4' ) }} < br > {{ Storage :: url ( 'videos/video_1721131211471284370.mp4' ) }}
Recent posts

Base Table Or View Already Exists In Laravel Migration

Check Table Exists Or Not In Laravel Migration Let’s create a users table only if the users table doesn’t exist in the database.   <?php     use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema;     class CreateUsersTable extends Migration {      /**       * Run the migrations.       *       * @return void       */      public function up()      {            /*           * If users table does not exists then create           * Your newly appended changes won't be added if table already exists           */       ...

Laravel - Remove Public from URL using htaccess

  Step 1: Rename File In first step it is very easy and you need to just rename file name. you have to rename server.php to index.php at your laravel root directory. server.php INTO index.php   Step 2: Update .htaccess first of all you have to copy .htaccess file and put it laravel root folder. You just copy .htaccess file from public folder and then update bellow code: .htaccess Options -MultiViews -Indexes RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f Re...

Send email Laravel

  use  Illuminate\Support\Facades\ URL ; use   Redirect , Response , DB , Config ; use   Mail ; use   Session ;     public   function   send ( Request   $request )     {          $name = trim ( $request -> txtName );          $numPhone = trim ( $request -> numPhone );          $txtEmail = trim ( $request -> txtEmail );          $textMessage = trim ( $request -> textMessage );          $to_name  =  'Headless' ;          $to_email  =  'hello@bowerhousedigital.com.au' ;                   $data  =  array ( 'name' => $name ,  'numPhone' => $numPhone , ...

Laravel 8: Routing Change

  In a fresh laravel 8 install, I have this in my web.php file:      Route :: get ( '/' ,  'HomeController@index' );   and this in the index method of the HomeController.php          /**      * Display a listing of the resource.      *      *  @return  \Illuminate\Http\ Response      */      public   function   index ()     {          return   view ( 'welcome' );     }     error page:--   The way to define your routes in laravel 8 or above is        use  App\Http\Controllers\ HomeController ;      / / Using PHP callable syntax...      Route :: get ( '/' , [ HomeCont...

make routes

  Route :: get ( '/' ,  'HomeController@index' ); Route :: get ( '/explore/{type?}' ,  'HomeController@explore' ); Route :: get ( '/learn/{id?}' ,  'HomeController@howorks' ); Route :: get ( '/contact-us' ,  'HomeController@contactUs' ); Route :: get ( '/queryrun' ,  'HomeController@queryrun' ); Route :: post ( '/contact-us/sendmail' ,  'HomeController@contactmail' )-> name ( 'sendmail' );

Validation and save

  public   function   store ( Request   $request )     {          $validatedData  =  $request -> validate ([              'first_name'  =>  'required|string|max:50' ,              'last_name'  =>  'required|string|max:50' ,              'scanner_id'  =>  'required|unique:drivers,scanner_id' ,              'email_address'  =>  'required|string|email|unique:drivers,email_address' ,              'phone_number'  =>  'required|numeric|digits:10' ,              'manager_id'  =...