skip to Main Content

Laravel: regenerate cache

I am using cache to store data structure from database: Cache::forever(static::DATA_STRUCTURE, json_encode($tree)); However before I generate there should cleaned old: Artisan::call('cache:clear'); But generating new cache takes some time and I want to store old cache until new will be generated.…

VIEW QUESTION

Laravel – The GET method is not supported for route produk/index. Supported methods: POST

My error The GET method is not supported for route produk/index. Supported methods: POST. Route::post('/produk/index', [ProdukController::class,'index'])->name('produk.index'); web.php <?php use IlluminateSupportFacadesRoute; use AppHttpControllersLoginController; use AppHttpControllersProdukController; use AppHttpControllersSupplierController; /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register…

VIEW QUESTION

Illegal operator and value combination in Laravel 8

Why is there always an error when doing more than seven days? public function paginated(Request $request) { $fromDate = $request->fromDate ? Carbon::parse($request->fromDate) : Carbon::now(); $toDate = $request->toDate ? Carbon::parse($request->toDate) : Carbon::now(); $query = Vehicle::with('make') ->with('class') ->with([ 'status' => function ($query)…

VIEW QUESTION

Override last() method in laravel

I have one to many relations In my User Model public function user_balances(){ return $this->hasMany(UserBalances::class); } In my User Balances Model public function user(){ return $this->belongsTo(UserBalances::class); } So every time I want to retrieve the last record of user balance,…

VIEW QUESTION

Php – Laravel 8 prefix on route not working when placed and url works with prefix if its not on code

I have a routes folder admin.php, with following intended code Route::prefix('admin')->group(function(){ Route::get('/new/dashboard',[SuperAdminController::class,'dashboard']); Route::get('/new/notifications', [SuperAdminController::class,'notifications']); }); But if i go on the browser and use http://127.0.0.1:8000/admin/new/dashboard i get 404 | page not found. But if remove the prefix and the code…

VIEW QUESTION

Adding Server Block on Nginx for WildCard domains

I have 2 domains as D1 "abc.com" and D2 "def.com". I have configured D1 as following sever block on Nginx. server { listen 80; server_name *.abc.com,abc.com; root /var/www/abc/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; index index.php; charset utf-8; location /…

VIEW QUESTION
Back To Top
Search