Configuring the `.env` file in Laravel
I want to configure both MySQL and MongoDB connections in my .env file in Laravel. How can I set the following parameters for both: DB_CONNECTION= DB_HOST= DB_PORT= DB_DATABASE= DB_USERNAME= DB_PASSWORD=.
I want to configure both MySQL and MongoDB connections in my .env file in Laravel. How can I set the following parameters for both: DB_CONNECTION= DB_HOST= DB_PORT= DB_DATABASE= DB_USERNAME= DB_PASSWORD=.
I'm currently develop a web application with Laravel. My database engine is a Microsoft SQL Server. For some data I preferred to generate an uuid. When I use Windows to run my Laravel app, the uuid format is correct :…
I have a issue while trying to mock multi Storage in laravel test enviromnment. Here is my my code: public function sftp ( Sibling $sibling ) { $file_paths = Storage::build($sibling->config) ->files($this->track->track_token); Storage::disk('public') ->makeDirectory($this->track->track_token); foreach ( $file_paths as $file_path ) {…
public function get_user_documents() { $userId = Auth::id(); $user_documents = UserDocument::where('user_id', $userId) ->orWhereHas('share_documents', function ($query) use ($userId) { $query->where('users.id', $userId); }) ->with(['share_documents' => function ($query) use ($userId) { $query->where('users.id', $userId); }]) ->latest() ->get(); // $user_documents = $user_documents->map(function ($document) use ($userId) {…
I'm using Laravel 9 and PHP 8.0. When I try to update a user, I get the following exception: SQLSTATE[22007]: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Conversion failed when converting date and/or time from character string. I think the query…
Laravel group by if column value exits then group by perform other wise as it is return records in single laravel query i have tried this $sql = $this->expense->builder()->where('session_year_id',1)->whereNull('staff_id')->orWhereNotNull(function($q){ $q->groupBy('month'); })->get();
I am trying to provide some hardcoded data (for the testing purposes only) from my controller like this return redirect()->route('admin.my-view.edit', $prop)->withToastSuccess('Success')->with(['data' => ['test1', 'test2']]); And in my edit page I am trying to dump data like this @dump($data ?? '')…
I have a need to create a migration that changes an existing 'unsignedMediumInteger' column to nullable(). I have the following in my migration: <?php use IlluminateDatabaseMigrationsMigration; use IlluminateDatabaseSchemaBlueprint; use IlluminateSupportFacadesSchema; use AppNewModelsSubscriptionType; return new class extends Migration { public function…
So I have this component included in my main layout file, it looks like this: <script setup> import {usePage} from "@inertiajs/vue3"; import {computed} from "vue"; const page = usePage() const message = computed(() => page.props.flash.message) if (message) { Swal.fire({ text:…
I have 2 different databases where i am using MySQL with 2 different database using laravel 9. The 1st database name as stores and 2nd database name as producers . I want to use this 2 different database in my…