Category : frameworks

I am new to laravel framework and I am not clear about laravel object creation. How laravel creates object of classes? Like for Eg. I have controller called class MyTestController and it has method defined called MyMethod() This is route for this controller, Route::get(‘Test’,[MyTestController::class,’MyMethod’]); when I hit — http://localhost:81/laravel_project/Test, MyMethod() gets called. I have not ..

Read more

I’ve recently been looking into the Laravel PHP framework. Since I have never worked with backend frameworks, it feels quite complex. Is there maybe something smaller on the market for developing smaller, RESTful Web Apps, specifically with vue.js in the Frontend, which require only a manageable logic? As a beginner, it would of course be ..

Read more

BadMethodCallException Method AppHttpControllersOrderController::rajaOngkirRequest does not exist. IlluminateRoutingController::__call C:xampphtdocslaravel7-larashop-feature-E.10-rest-api-product-cataloguevendorlaravelframeworksrcIlluminateRoutingController.php:68 <?php namespace IlluminateRouting; use BadMethodCallException; abstract class Controller { /** * The middleware registered on the controller. * * @var array */ protected $middleware = []; /** * Register middleware on the controller. * * @param Closure|array|string $middleware * @param array $options * @return IlluminateRoutingControllerMiddlewareOptions */ public ..

Read more

in my code is enter image description here and then when I click to edit or delete I found 404 not found on my website like this one this is an error problem for me and in code route web.php Route::get(‘/rekaman/blog/edit/{$id}’,’[email protected]’); Route::get(‘/blog/{$id}/hapus’,’[email protected]’); and then this my code for BlogController public function edit($id) { $artikel = ..

Read more

There a few schools under HQ and same things goes to franchise. I want to create a dropdown list when I click "Centre" to create new data, it will also create a new data for the all schools who have been group by centre Here is my controller $this->centre= $this->db->get_where(‘schools’, array(‘group_by’=>’centre’))->result(); And this is views ..

Read more

This is the code I used but I am getting this error "syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR), expecting ‘;’", hitting this error in the success line. everything looks fine for me. public function store(Request $request) { $validator = Validator::make($request->all(),[‘file’ => ‘required|max:5000|mimes:xlsx,xls,csv’]); if ($validator->passes()) { return redirect->back()->with([‘success’ => ‘Data Uploaded Successfully’]); } else { return redirect->back()->with([‘errors’ ..

Read more

I have DB table with following columns id|name|email|role|password|etc. And I want to restrict some content of my view page when the user isn’t admin(role type). I have the following code but something went wrong and I’m getting not awaited result. Code in my AuthServiceProvider Gate::define(‘restricted-view’,function($user){ return $user->role == ‘admin’; }); Code in my Controller $user ..

Read more

I’ve got the following model: <?php namespace App; use IlluminateDatabaseEloquentModel; class Product extends Model { protected $guarded = [‘id’]; public static function rules() { return [ ‘created_at’ => ‘nullable’, ‘updated_at’ => ‘nullable’, ‘name’ => ‘required|string|between:1,255’, ‘description’ => ‘required|string|between:1,255’, ‘date_added’ => ‘nullable’, ‘date_edited’ => ‘nullable’, ‘unit’ => ‘required|string|between:1,255’, ‘unit_type’ => ‘required|integer’, ‘stock’ => ‘nullable|string|between:0,255’, ‘barcode’ => ..

Read more

Estou tentando mudar o comportamento padrão da classe IlluminateSessionCookieSessionHandler para que quando o método destroy seja invocado seja registrado na base de dados quando uma sessão do usuário foi encerrada. Como essa classe se encontra do fornecedor de lista e este é reescrito para cada atualização do framework, decidi criar uma nova classe e estender ..

Read more

composer create-project –prefer-dist laravel/laravel testlaraval i use this command but it install laraval – Installing laravel/laravel (v6.18.35): Extracting archive i need laraval 8.5 after that i used composer create-project –prefer-dist laravel/laravel livemart 8.5. but it showed this, [InvalidArgumentException] Could not find package laravel/laravel with version 8 in a version installable using your PHP version, PHP ..

Read more