Categories
Development Laravel

Undefined variable Laravel (strange case)

I am m having this annoying problem. Can anyone give a hand to sort out it? I read all posts and I cannot find the solution. This is my controller <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Auth; use DB; use App\Post; use App\RegisteredCourse; class DashboardsController extends Controller { public function indexA() { return view(‘dashboards.admin-dashboard’); } […]

Categories
Development Laravel

orderBy on hasMany relationship laravel

I made a “hasMany” relationship from Category model to Product model using ProductCatRel model. I am trying to ordering my products form Category model. The “where” condition is fine, But “orderBy” is not working. Here is my code: public function Products(){ return $this->hasMany(ProductCatRel::class,’category’) ->with(‘Product’) ->whereHas(‘Product’, function($q){ $q->where(‘status’, 1)->orderBy(‘position’); }); }

Categories
Development Laravel

get all session from one suffix in laravel

i want to create a shop site by laravel. now i want create cart page in my site. i want to create a session for every one product that user want to shop it. and showing them in cart page all information from product saving in a array. and i create a session with this […]

Categories
Development Laravel

update session array value in laravel 6

i have a session with array value in laravel and i want to edit one array member when page is refresh my session like this $data = [ ‘product’ => $request->input(‘product’), ‘price’ => $request->input(‘price’), ‘quantity’ => 1 ]; $request->session()->put(‘cart_’. $request->input(‘id’) , $data); and i want to plus price value when page refreshed like this before […]

Categories
AJAX Development Laravel

Submitting large files Laravel and Ajax

I have a form where user submit and add product with multiple images to the database through Ajax request. The problem is when I choose a lower(12kb) image it save the product but if it is large file(1mb) or (400kb) it doesn’t save the product. I have set the limit of upload to 10000mb, how […]

Categories
Development Laravel

how to override storage class methods ‘Storage::has()’ and ‘Storage::get()’ in Laravel?

I need to extend the storage class methods so i can have my own definition of has() and get() methods, as i need to perform additional checks too, because when i use S3, the has() method errors out when thee connection is poor or has some other server related issue. class Storage extends \Illuminate\Filesystem\FilesystemManager { […]

Categories
AJAX Database Development Laravel

How to handle the data received to save it in the database Laravel and Ajax?

I’m trying to add the product with multiple images to the database without refreshing the page, I don’t get any errors on console but I see the long text which starting like this <script> Sfdump = window.Sfdump || (function (doc) { var refStyle = doc.createElement(‘style’), rxEsc = /([.*+?^${}()|\[\]\/\\])/g, idRx = /\bsf-dump-\d+-ref[012]\w+\b/, keyHint = 0 <= […]

Categories
Development Laravel

Why fontawesome icons in laravel does not showing?

I already install the fontawesome in my package.json “devDependencies”: { “@fortawesome/fontawesome-free”: “^5.11.2” , //etc. }, “dependencies”: { “font-awesome”: “^4.7.0” } and import it to my app.scss @import “~font-awesome/scss/font-awesome.scss”; I tried <i class=”fa fa-edit”></i> and <i class=”fas fa-edit”></i> but it just shows like this below, someone knows how to do this correctly?

Categories
Development Laravel

Why are not working laravel route method for specific number? What are the solution of this?

I have a school management project which created with laravel php framework. when i add subject number for class ‘Four’ or ‘Eight’ then i face a problem which is “Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message” But if i add number accept “four” or “eight” class then i have not face […]

Categories
Development Laravel Vue

Laravel routes not working when using Vue Router

I am trying to call a laravel route Route::get(‘/logout’, ‘Auth\LoginController@logout’); that will logout the user and redirect to the login page, but when I try to redirect to this url it won’t work, anything happens, just like it was calling a vue router route, but this route does not exists in my router.js. This is […]