laravel-5.6

Upgrading Laravel 5.5 to 5.6 error

[亡魂溺海] 提交于 2019-11-28 06:47:19
I am trying to upgrade my Laravel 5.5 to 5.6. I have followed the instructions from the laravel website, yet I got this error: Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package laravel/framework 5.6.* is satisfiable by laravel/framework[5.6.x-dev] but these conflict with your requirements or minimum-stability. So, I changed my composer.json file and added 2 lines: **"minimum-stability": "dev", "prefer-stable": true,** based on the first answer on this laracast discussion. Everything seemed to be working just fine until I got another

L5.6 - Relation on pivot table

断了今生、忘了曾经 提交于 2019-11-28 05:54:58
问题 I've a relation on a pivot table; how I can expand It? For example: shops : id name products : id name product_shop : product_id shop_id field_1 field_2 field_3 table_A_id table_A : id name The relation Many-to-Many in the Shops Model is: class Shops extends Model { public function products() { return $this->belongsToMany('Products', 'product_shop', 'product_id', 'shop_id')->withPivot( 'field_1', 'field_3', 'field_3', 'table_A_id' ) ->as('product_shop') ->withTimestamps(); } } and the query

Laravel installer keeps installing 5.5 instead of 5.6

我与影子孤独终老i 提交于 2019-11-28 01:57:12
I installed php 7.2.2 / apache 2.4 and mysql-5.7 on windows 10. I want to install laravel 5.6 first: 1. composer clear-cache 2. composer update 3. composer global require "laravel/installer" php -v: PHP 7.2.2 (cli) (built: Jan 31 2018 19:31:17) ( ZTS MSVC15 (Visual C++ 2017) x64 ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies and Laravel Installer 2.0.1 I try this (according to the laravel doc 5.6): composer create-project --prefer-dist laravel/laravel blog But it install laravel 5.5.28 Why does composer keep installing laravel 5.5? Laravel

How can I convert array two dimensional to collection laravel?

懵懂的女人 提交于 2019-11-27 08:29:24
问题 I have array like this : $test = array( array( 'name' => 'Christina', 'age' => '25' ), array( 'name' => 'Agis', 'age' => '22' ), array( 'name' => 'Agnes', 'age' => '30' ) ); I want to change it to collection laravel I try like this : collect($test) The results are not perfect. There is still an array How can I solve this problem? 回答1: collect($test) does not convert $test to a collection, it returns $test as a collection. You need to use it's return value for a new variable, or override the

Upgrading Laravel 5.5 to 5.6 error

守給你的承諾、 提交于 2019-11-27 01:15:24
问题 I am trying to upgrade my Laravel 5.5 to 5.6. I have followed the instructions from the laravel website, yet I got this error: Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package laravel/framework 5.6.* is satisfiable by laravel/framework[5.6.x-dev] but these conflict with your requirements or minimum-stability. So, I changed my composer.json file and added 2 lines: **"minimum-stability": "dev", "prefer-stable": true,** based on the

How can I implement Resource Controllers if I use many “get” on the laravel?

佐手、 提交于 2019-11-26 14:53:01
问题 I have routes laravel like this : Route::prefix('member')->middleware('auth')->group(function(){ Route::prefix('purchase')->group(function(){ Route::get('/', 'Member\PurchaseController@index')->name('member.purchase.index'); Route::get('order', 'Member\PurchaseController@order')->name('member.purchase.order'); Route::get('transaction', 'Member\PurchaseController@transaction')->name('member.purchase.transaction'); }); }); My controller like this : <?php ... class PurchaseController extends