laravel

    1熱度

    1回答

    有沒有一種方法可以在Carbon中的兩個日期之間得到一個隨機日期?例如,我試圖從現在到55分鐘前獲得一個隨機日期。 $dateNow = Carbon::now(); $date25MinsAgo = Carbon::now()->subMinutes(55); 但是,我被困在這一點。我在php上發現了一些信息,但我想用'now'作爲播種器。我該怎麼辦?

    1熱度

    2回答

    我遇到了計劃通知問題, 我在laravel 5.3中有一些通知,通知正在使用ShouldQueue接口和Queueable特性排隊。 問題是我想在特定小時之間發送通知,通知功能中內置的唯一選項是使用延遲方法。 如何爲正在排隊的通知制定自定義計劃?

    1熱度

    3回答

    我正在開發一個web應用程序,並觀察REST API標準。我正在尋找訂閱和付款的REST API最佳實踐。 當新用戶訂閱「專業計劃」時,用戶應該爲計劃付錢,這是一筆交易。 當新用戶訂閱時,我應該設置POST:users/{id}/subscriptions和[email protected]嗎? 由於訂閱是一個交易和兩個分開的請求(銀行之前/之後),所有的訂閱代碼應該在[email protect

    0熱度

    3回答

    問題是視圖中的未定義變量。 我的控制器: use App\Book; class bookController extends Controller { public function index() { $books = Book::all(); return view('frontend.index')->with('books', $books); } }

    0熱度

    1回答

    我想合併幾個集合,但我無法做到這一點,出於任何原因。我的代碼如下所示: $restaurant = \App\Restaurant::find(3); $images = $restaurant->images; $userimages = $restaurant->userimages; $hours = $restaurant->hours; $collectionMerge1

    4熱度

    1回答

    我請求類: class UpdateProductRequest extends ApiRequest { public function authorize() { return true; } public function rules() { return [ 'name' => 'required

    1熱度

    1回答

    我有一個mysql表,其中包含消息。每條消息在系統中的當前狀態都有一個狀態。我們想要生成比較開放消息和其他消息的圖表。我想創建一個JSON響應,看起來如下: Roofing: [ open: 12, others: 24 ], Building: [ open: 4, others: 32 ] 這是MySQL數據庫的外觀 +---+--------

    0熱度

    3回答

    我試圖從CategoriesController.php到達items表,但我在Laravel(5.3)Debugbar中看到,我的查詢沒有執行。爲什麼?這裏是我的代碼: # Http/Controllers/CategoriesController.php use App\Category; use App\Item; use App\Http\Requests; use App\Ht

    0熱度

    1回答

    通過Laravel的一些視頻學習,但碰到一個問題,我似乎無法弄清楚。 我有一個路線 Route::get('/post/{id}/{name}/{password}', '[email protected]'); 稱爲PostController.php public function showPost($id, $name, $password) { return view('p

    0熱度

    1回答

    我想限制表中的一個條目,我不知道該怎麼做。 我讀過有關firstOrCreate,但在我的模型,我有: use Illuminate\Database\Eloquent\Model; class Ad extends Model { protected $fillable = [ 'title', 'description', 'image'