Laravel eloquent limit query

I have 3 tables TAble, TableB and TableC. each one with 1 milion registers. And i have the Laravel eloquent query. $list= TableA::with([ ‘TableB’, ‘TableC’ ]) ->whereIn(‘field1’,[‘A’,’B’,’C’]) ->where(‘created_at’,’>=’,’2018-01-01′) ->orderBy(‘fieldC’, ‘ASC’)->orderBy(‘created_at’, ‘ASC’) ->get() ->take(50) ; TableA have TableB and TableC mapping this way. public function TableB(){ return $this->belongsTo(‘TableB’, ‘fk_id’, ‘id’); } public function TableC(){ return $this->hasMany(‘TableC’);…

How to get url of images which is saved in firebase storage into variable using Laravel

I used the following code to upload the image in storage var filename = selectedfile.name; var storageRef = firebase.storage().ref(‘/driverimages/’+filename); var uploadtask = storageRef.put(selectedfile); I need to get saved image url to laravel php variable. I used the following code for that. But it’s not working. How can I do that? uploadTask.on(‘state_changed’, function(snapshot){ // Observe state…

How to use a custom list of values for a Laravel factory, maintaing order and still using the Faker facade?

I have a list of names $names = [‘Adam’,’Beth,’Chancie’,’Dale’, ‘Edward’]; etc.. That I want to use in a Laravel factory, or seeder, I don’t know which one. Basically, I still want to use the Faker functionality for everything else, but provide my own custom list of names in the order they are listed in the…

Vuetify not being applied in Laravel

I have Vuetify installed in my Laravel project but none of the v- classes are working. There are no errors in the console though. Here is the app.js file: require(‘./bootstrap’); window.Vue = require(‘vue’); import Vuetify from ‘vuetify’ Vue.use(Vuetify); Vue.component(‘container-component’, require(‘./components/ContainerComponent.vue’).default); Vue.component(‘index-component’, require(‘./components/IndexComponent.vue’).default); const vuetify = new Vuetify(); const app = new Vue({ el: ‘#app’, vuetify…

How do I stop Create action from execution in laravel while there is some dependency error

I am creating user from the details I get from the user details table, My Controller public function store(Request $request) { // Section 1 $user = User::create( [ ‘name’ => $request->input(‘first_name’), ’email’ => $request->input(’email’), ‘row_status’ => ‘1’, ‘user_type’ => ‘3’, ‘password’ => bcrypt(‘RandomPassword@123’) ] ); // Section 2 $technician_register = new Technician(); $technician_register->user_id = $user->id;…