Category "laravel"

Natural ORDER in Laravel Eloquent ORM

How can i get 'natural order' in 'Eloquent ORM'? In table I have column 'text' (string). Normal order: Model::orderBy('text') 'value 1' 'value 12' 'value 23'

PHP web3 ERC20 token function call

I have a Smart Contract that represent ERC20 token. I already deployed the smart contract on Binance Testnet using HardHat. I have a deployed Smart Contract add

Connecting Laravel with SQL Server database always shows error "could not find driver"

I want to connect Laravel (version 8), with a SQL Server database (SQL Server 2008 R2). I've done the installation and followed some tutorials with steps like t

my cron job is not working whats wrong in it

i apply a cron job where i want to update some values but my cron job is not working whats wrong in it here is my code in kernel.php namespace App\Console; use

How to get unique slug to same post-title for other time too?

I have tried the codes as follows. $post->title = $request->title; $post->body = $request->body; $post->slug = str_slug($post-

Laravel passport: assigning the scopes to access token overriding oauth/token route

I am working on a Laravel project. I am using Laravel Passport for API authentication. I am trying to assign the scopes to the access token based on the user ro

How to make repository in laravel

I am new to laravel repository. I want to make a repository in laravel. I tried this command php artisan make:repository UserRepository but command shows make:r

How to KeyBy where multiple items have the same key

I am using Laravel Collections methods and am trying to key my query results (which are a collection) by the id. The problem is I have multiple entries with the

Please help improve the data to be compiled [closed]

I have data with the table as follows: enter image description here In my Model: <?php namespace App; use Illuminate\Database\Eloquent\Mo

Laravel 5.1 Unknown database type enum requested

While running php artisan migrate, I got the following error [Doctrine\DBAL\DBALException] Unknown database type enum requested, Doctrine\DBAL\Platforms

Laravel: Select first record in a One-to-Many relation

Is it possible to use eloquent to retrieve just the first match in a one to many relationship? What do I mean, well, let me explain. Most of us are familiar wit

How do I store files in vue.js?

I want to store image files and video files but the data is showing Blob. The video file and image file displays as soon as uploaded which is cool. Please, I

getting error while enter Command => php artisan route:list

This laravel code is running on my localhost when try to execute any command its throwing below error. please find me a solution why it's throwing such error

Laravel csrf token mismatch for ajax POST Request

I am trying to delete data from database via ajax. HTML: @foreach($a as $lis) //some code <a href="#" class="delteadd" id="{{$lis['id']}}">Delete<

Laravel Excel::store file empty after stored

I uploaded this excel file: myExceldocument.xlsx After uploading I want to store in a folder. I used this method: $uploadedFile = $request->file('files')[0]-

Laravel socialite error 404

I followed this tutorial on how to use socialite -> https://laracasts.com/series/whats-new-in-laravel-5/episodes/9 This is what I've done: Added to my comp

Can you create a new Model instance without saving it to the database

I want to create a whole bunch of instances of a model object in Laravel, then pick the optimal instance and save it to the database. I know that I can create

Laravel You requested 1 items, but there are only 0 items available

I am getting row's column randomly to seed database, using eloquent : $physician = SelectOption::where('select_option_group_id', 1)->pluck('name')->rando

Laravel 9: change table and fields for authentication and login

I have changed the table and the Laravel Breeze fields for authentication to some custom ones. It looks fine but in AuthenticatedSessionController.php while I g

Sentry + Laravel: how to log an already catched Exception?

We're using Laravel ( 5.x to 7.x ) in a lot of project and all integrated with Sentry. In some edge case we need to catch some recoverable exceptions to allow p