https://youtu.be/vfuAPIYSYvc Step 1: Install the laravel project using the command line. composer create-project –prefer-dist laravel/laravel laravelDragDrop Step 2: Open project in code and use vs code terminal. cd laravelDragDrop Step 3: find .env file in root directory setup database configuration. DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=database_name DB_USERNAME=database_username DB_PASSWORD=database_password Step 4: Route Open routes/web.php file. Define 2 routes Route::get(‘image’, ‘DropzoneController@dropzone’); Route::post(‘dropzone/store’, ‘DropzoneController@dropzoneStore’)->name(‘dropzone.store’); Step 5: Controller Create DropzoneController Controller. php artisan make:controller DropzoneController Open app/Http/Controllers/DropzoneController.php file. <?php namespace App\Http\Controllers;…
https://www.youtube.com/watch?v=Xs_ohuTsdx8&ab_channel=Realprogrammer Step 1: Install the laravel project using the command line. composer create-project –prefer-dist laravel/laravel laravel7autocomplete Step 2: Open project in code and use vs code terminal. cd laravel7autocomplete Step 3: find .env file in root directory setup database configuration. DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=database_name DB_USERNAME=database_username DB_PASSWORD=database_password Step 4: run Migration command php artisan make:migration create_category_table Now, navigate to database/migration/ directory from the project root.Find a PHP file which ends with create_category_table and open it. Define…
<?php $str = ‘<p><span style=”color: #444444; font-family: arial; font-size: 16px; letter-spacing: 0.6px; background-color: #ffffff;”>Established in year</span><strong style=”color: #444444; font-family: arial; font-size: 16px; letter-spacing: 0.6px; background-color: #ffffff;”> 2007, </strong><strong style=”color: #444444; font-family: arial; font-size: 16px; letter-spacing: 0.6px; background-color: #ffffff;”>Galaxy Computer </strong><span style=”color: #444444; font-family: arial; font-size: 16px; letter-spacing: 0.6px; background-color: #ffffff;”>is </span><strong style=”color: #444444; font-family: arial; font-size: 16px; letter-spacing: 0.6px; background-color: #ffffff;”>Wholesale Trader and Service Provider</strong><span style=”color: #444444; font-family: arial; font-size: 16px; letter-spacing: 0.6px; background-color: #ffffff;”> of </span><strong style=”color: #444444; font-family: arial;…
use Illuminate\Support\Carbon; $stale_posts = Test::where(‘updated_at’, ‘<‘, Carbon::now()->subDays(7))->get(); foreach ($stale_posts as $post) { $post->delete(); }
In folder config => database.php make sure mysql strict is false, like this ‘mysql’ => [ ‘driver’ => ‘mysql’, ‘url’ => env(‘DATABASE_URL’), ‘host’ => env(‘DB_HOST’, ‘127.0.0.1’), ‘port’ => env(‘DB_PORT’, ‘3306’), ‘database’ => env(‘DB_DATABASE’, ‘forge’), ‘username’ => env(‘DB_USERNAME’, ‘forge’), ‘password’ => env(‘DB_PASSWORD’, ”), ‘unix_socket’ => env(‘DB_SOCKET’, ”), ‘charset’ => ‘utf8mb4’, ‘collation’ => ‘utf8mb4_unicode_ci’, ‘prefix’ => ”, ‘prefix_indexes’ => true, ‘strict’ => false, ‘engine’ => null, ‘options’ => extension_loaded(‘pdo_mysql’) ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env(‘MYSQL_ATTR_SSL_CA’), ]) : [], ], if strict is true, make it…
Here is my configuration to make HTTPS working with assets. To enable this in production add REDIRECT_HTTPS=true in the .env file. REDIRECT_HTTPS=true <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Schema; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { if(env(‘REDIRECT_HTTPS’)) { \URL::forceScheme(‘https’); } Schema::defaultStringLength(191); } /** * Register any application services. * * @return void */ public function register() { // } }
Conditions using Array: $users = User::where([ ‘column1’ => value1, ‘column2’ => value2, ‘column3’ => value3 ])->get();
$data = DB::table(“productTesting”) ->select(“productTesting.*”,”categories.*”) ->join(DB::raw(“(SELECT categories.id, GROUP_CONCAT(categories.name) as categoriesName FROM categories GROUP BY categories.id ) as categories”),function($join){ $join->on(“categories.id”,”=”,”productTesting.categoryId”); }) ->groupBy(“productTesting.id”) ->get(); dd($data);
Run below command inside of your project – php artisan config:cache – php artisan config:clear – php artisan cache:clear
Step 1: Install Laravel 7 Project I am going to install a laravel project using composer. composer create-project –prefer-dist laravel/laravel laravel7 Step 2: Going inside of project using the command cd laravel7 Step 3: Setup MySQL database Now, configure this database in the .env file. DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel7 DB_USERNAME=root DB_PASSWORD=root@123 Step 4: Create employee_images Table and Model also. Here, I have created migration for employee_images using Laravel 7 php artisan command, you can check…