laravel

How to use order by query both with current table column and relationship table column in laravel?

笑着哭i 提交于 2021-02-11 14:45:24
问题 i am trying to fetch record with order by query but situation is this that i have to use order by both on current table column and relationship table column in laravel . I tried this $consignments = Consignment::where('delivery_run_id', $id)->whereIn('status', [ 'In Warehouse', 'With On Forwarder', 'In Transit (Warehouse->Delivery)', 'Awaiting Pickup' ])->with(['consignment_run_sheet' => function ($query) { $query->orderBy('run_sheet_id'); }])->orderBy('delivery_date', 'DESC')->get();

multi level subcategory in laravel

徘徊边缘 提交于 2021-02-11 14:44:22
问题 i want to show categories list on selectbox with tree structure (multi level subcategory) similar this: -electronic --camera ---sumsung ---- other subcategory ---- ... ---lg -art table structure: +----+------------+-----------+ | id | name | parent_id | +----+------------+-----------+ | 1 | electronic | 0 | +----+------------+-----------+ | 2 | arts | 0 | +----+------------+-----------+ | 3 | camera | 1 | +----+------------+-----------+ | 4 | sumsung | 3 | +----+------------+-----------+ | 4

HERE REST API OAuth 2.0 Token Request (with a 1.0 header) Error

孤者浪人 提交于 2021-02-11 14:44:13
问题 I've been trying to get my PHP application to create a successful token request since finally managing to get it working with Postman as per the docs here Apparently the API is using OAuth 2.0 which is why I expect to send up grant_type , client_id , client_secret and expires_in (if I don't specify one of these fields then the API will successfully tell me it is missing). Now the problem I am having is with this OAuth 1.0 Authorization Header that I am having to generate, which Postman seems

multi level subcategory in laravel

时间秒杀一切 提交于 2021-02-11 14:43:01
问题 i want to show categories list on selectbox with tree structure (multi level subcategory) similar this: -electronic --camera ---sumsung ---- other subcategory ---- ... ---lg -art table structure: +----+------------+-----------+ | id | name | parent_id | +----+------------+-----------+ | 1 | electronic | 0 | +----+------------+-----------+ | 2 | arts | 0 | +----+------------+-----------+ | 3 | camera | 1 | +----+------------+-----------+ | 4 | sumsung | 3 | +----+------------+-----------+ | 4

Why i got other url in active url laravel?

爱⌒轻易说出口 提交于 2021-02-11 14:41:45
问题 I am using Laravel 8 and I am facing issue with URL on local server ubuntu . When I on http://www.ereciept.com/ route then each and everything working fine. If i hit an other route like http://www.ereciept.com/invoices/show and then i cal ajax route http://www.ereciept.com/language/key then the hit url become http://www.ereciept.com/invoices/language/key. I don't know what happening. My we file is Route::get('language/{key}', [SwitchLanguageController::class, 'switchLanguage'])->name(

Validate unique name and firstname in Laravel

倖福魔咒の 提交于 2021-02-11 14:41:11
问题 I know the subject exists, but I haven't found a solution so far. I have a table which is named players with two fields: name, firstname. My goal is to have neither duplicate when I enter several entries. I want to get this result. Fostier | Alain Fostier | Jeremy If I have two times Fostier | Alain it's not correct. The duplicate system should combine only the ID? I have tried the following without success. public function store(Request $request) { $request->validate([ 'name' => 'required

AWS EB undefined RDS_HOSTNAME with Database hosts array empty

百般思念 提交于 2021-02-11 14:40:02
问题 Currently in a Laravel project using AWS EB with RDS. When I run php artisan migrate --seed then I get PHP Notice: Undefined index: RDS_HOSTNAME in /var/app/current/config/database.php on line 5 PHP Notice: Undefined index: RDS_USERNAME in /var/app/current/config/database.php on line 6 PHP Notice: Undefined index: RDS_PASSWORD in /var/app/current/config/database.php on line 7 PHP Notice: Undefined index: RDS_DB_NAME in /var/app/current/config/database.php on line 8 and Database hosts array is

AWS EB undefined RDS_HOSTNAME with Database hosts array empty

懵懂的女人 提交于 2021-02-11 14:35:34
问题 Currently in a Laravel project using AWS EB with RDS. When I run php artisan migrate --seed then I get PHP Notice: Undefined index: RDS_HOSTNAME in /var/app/current/config/database.php on line 5 PHP Notice: Undefined index: RDS_USERNAME in /var/app/current/config/database.php on line 6 PHP Notice: Undefined index: RDS_PASSWORD in /var/app/current/config/database.php on line 7 PHP Notice: Undefined index: RDS_DB_NAME in /var/app/current/config/database.php on line 8 and Database hosts array is

Laravel 5.6 “Unresolvable dependency resolving…” when doing dependency injection

被刻印的时光 ゝ 提交于 2021-02-11 14:34:03
问题 I am trying to bind a class into the container via a middleware and it doesn't seem to work because the class that I am binding recieved 2 parameters in the constructor and they aren't recognised. I am getting the following error message: " Unresolvable dependency resolving [Parameter #0 [ $base_url ]] in class App\Services\Factureaza ". Here is the middleware: <?php namespace App\Http\Middleware; use App\Services\Factureaza; use Closure; class InitializeInvoiceProvider { public function

How to send JSON Object from React Native to Laravel Server?

倖福魔咒の 提交于 2021-02-11 14:21:48
问题 I have these JSON Objects that I want to send to my API so I can save them on my database : JSON Objects const utility = { con: [ { "name": "Michel", "phone": "+213 93 783 28 73", "users_id": "1"}, { "name": "Annie", "phone": "+213 93 783 28 72", "users_id": "1"}, { "name": "Rory", "phone": "+16505551212", "users_id": "1"}, { "name": "CESI", "phone": "+213 58 357 31 78", "users_id": "1"} ], } Post request from React Native : export default function Contact({ navigation }) { const { user,