Skip to main content

Posts

Showing posts from February, 2021

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...