Create public funtion in controller using for loop laravel

I am trying to create public funtions using for loop here is an example about what I want to do: class databaseController extends Controller { for ($i=0; $i < 5; $i++) { # code… public function tb.$i._create() { // dd(‘hoi_tb1_create’); if (Auth::guard(‘admin’)->user()->level == 2) { Schema::connection(‘mysql’)->create(‘tb’.$i, function($table) { $table->increments(‘id’); }); } // get all products…

Laravel – How to makeHidden multidimensional?

There is a multidimensional array. I want to makeHidden the children of the array: Model::with(‘someRelation’)->get()->toArray(); what I get is: array [ ‘something’, ‘something_else’, ‘something2’ => [ ‘something_inside_something2’ ] ] what I want to get is the array without something_inside_something2 inside something2. Something like this: Model::with(‘OtherModel’)->get()->makeHidden([‘something.something_inside_something2’])->toArray(); How can I do that?

When I’m try to use redis on my project laravel 6.x it show this error message

ERROR: Please remove or rename the Redis facade alias in your “app” configuration file in order to avoid collision with the PHP Redis extension I put this code on my cache.php ‘default’ => env(‘CACHE_DRIVER’, ‘redis’), And those code in my controller: $data[‘posts’] = cache(‘posts’,function(){ Post::with(‘user’) ->select(‘title’, ‘created_at’, ‘user_id’, ‘thumbnail_path’, ‘content’) ->orderBy(‘created_at’,’desc’) ->take(50) ->get(); });

Adapt my method store () for update () in Laravel 5.6

Here is my method store(). there is a check on the ceiling not to be reached. For information, the code is correct for the method store(). public function store(Request $request) { $request->validate([ ‘date_seance’ => ‘required’, ‘hour_start’ => ‘required’, ‘hour_end’ => ‘required’, ‘fk_student’ => ‘required’ ]); $date_seance = $request->get(‘date_seance’); $hour_start = $request->get(‘hour_start’); $hour_end = $request->get(‘hour_end’); $fk_student…

how to search all the locations from firebase for given distance and given latitude and longitude in laravel

This is my senario: I saved order details against restaurant in mysql database in following way. Id, order_no, name, lat, long etc and define radius of 5km of this order, now find the all locations of riders coming from real time database firebase. if someone (rider) gives his location in latitude and longitude to firebase.…