Skip to main content

Posts

Warning from https://repo.packagist.org: You are using an outdated version of Composer.

  This error occurs when i try to install vue in laravel 8. So the error says:    Warning from https://repo.packagist.org: You are using an outdated version of  Composer. Composer 2 is now available and you should upgrade. See  https://getcomposer.org/2 and when i try to install ui obviously it says: Command "ui" is not defined.  because it doesn't find the ui as it can't install the ui through composer. So, To solve that, Run: composer self-update then, composer update then,  composer require laravel/ui then, php artisan ui vue then,  npm install npm run dev. For, me this s...

Adding bootstrap to Vue Error (Can not resolve jquery)

 Error: These dependencies were not found: * jquery in ./node_modules/bootstrap/dist/js/bootstrap.js * popper.js in ./node_modules/bootstrap/dist/js/bootstrap.js Solution:  run the following code to install jquery and popper using npm. npm install --save jquery popper.js Then, npm install bootstrap And import bootstrap in main.js like this: import   'bootstrap' ;

Call to a member function map() on array

 I have faced this when i have used: return    $request -> clients -> map ( function ( $client ){              return   $client ;         }); it showed Call to a member function map() on array error. So to solve this I have used:  return    collect ( $request -> clients )-> map ( function ( $client ){              return   $client ;         });

Call to a member function middleware() on null

 In web.php I the following routes: web.php Route :: prefix ( 'app' )-> group ( function (){      Route :: post ( '/create_tag' , 'AdminController@addTag' ); })-> middleware ( AdminCheck :: class ); Here, middleware is AdminCheck. and in my AdminCheck middleware I wrote the following to test the middleware: AdminCheck.php   public   function   handle ( $request ,  Closure   $next )     {          if (! Auth :: check ())         {              return   'not loggedIn' ;         }          return   $next ( $request );     } Now when I reload the '/' url of the website it shows 'Call to a member function middleware() on null'  error. To solve this:  In web...