Category : laravel

I am writing up a cron job for daily email notification. Here are the scenario lets say User A gets 10 leads a day. User B gets 5 leads a day. User C gets 2 leads a day. i want to send one email to User A having 10 leads information in it. then one ..

Read more

I got 3 tables. Table 1 & 2 has their ids as foreign keys in third one(pivot). Relations for first one is $this->hasMany("AppPivot","game_id"); , second is $this->belongsToMany("AppPivot","army_id"); and pivot has relationships with both of them i.e belongsTo. My schema: I tried accessing it in controller of first one like this: $games= Game::with("armies")->get(); Result that i ..

Read more

I want to proccess data while server is sending data. I can draw a table with hardcode numbers but I canĀ“t set url to ajax query.. Ajax view: data: { ‘fecha_desde’: $("#fecha_desde").val(), ‘fecha_hasta’: $("#fecha_hasta").val(), ‘aplicacion’: JSON.stringify(ArrayAplicaciones), ‘equipos’: JSON.stringify(ArrayEquipos) }, ajax: function (data, callback, settings) { var out = []; for (var i=data.start, ien=data.start + data.length; ..

Read more

I have a problem in this code $query ->where(‘start_at’, ‘>=’, max($campaign->start_at, now())) ->where(‘end_at’, ‘<=’, $campaign->end_at) ->whereNull(‘deleted_at’) ->where(‘num_posti’, ‘>’, function ($query){ $query ->from((new Reservation())->getTable()) ->whereColumn(‘id’, ‘=’, ‘slots.id’) ->whereNull(‘deleted_at’) ->count(); }); The ‘slots.id’ field doesn’t see, but if I execute only the query’s first part i see this value. What is the problem? Sourc..

Read more

I use Laravel 7 .. in Admin Panel I added Permission of users registration like bellow <div class="custom-control custom-switch"> <input type="checkbox" class="custom-control-input" id="UserRegister" name="UserRegister" /> <label class="custom-control-label" for="UserRegister">{{ __(‘messages.Register’) }}</label> </div> from Ajax calling to Controller like public function permissionUsersPost(Request $request) { $UserRegister = $request->get(‘UserRegister’); // dd($UserRegister); if ($UserRegister == ‘true’) Auth::routes([‘register’ => true]); else ..

Read more

i have edit.blade.php (artbook view) and inside list of photos (from multiple upload – tables in relationship artbooks 1 : N photos): <div class="dataTables_wrapper"> <div class="table-responsive"> <table class="table table-striped" id="table"> <thead> … </thead> <tbody id="tablecontents"> @foreach(($artbook->photos) as $photo) @if(!is_null($photo)) <tr class="row1" data-id="{{ $photo->order }}"> <td>{{ $photo->order }}</td> <td><img class="img-responsive" src="/storage/photos/{{ $photo->filename }}" style="width:100%; height:auto;"/></td> <td><a ..

Read more

I was trying to compare this two times into a laravel application. But I can’t match them. The code is going below. I am using carbon laravel package. My goal is when $timeToday is equal to $timetommorow I want to print the message. echo $timeToday = Carbon::today()->now(); echo $timeTomorrow = Carbon::today()->addHours(23)->addMinutes(59)->addSeconds(59); if (Carbon::today()->now() == $timeTomorrow) ..

Read more

I am not able to implement email verification using laravel 8.x and Laravel Jetstream. As the instructions direct in the Laravel Jetstream documentation, I uncommented the emailVerification feature in config/fortify.php. Features::emailVerification(), I implemented the MustVerifyEmail interface in App/Models/User. use IlluminateContractsAuthMustVerifyEmail; I verified that both of these changes actually occurred on the server. I ran php ..

Read more

I am doing E2E tests with cypress. i have to count the number of rows in a table which are different from case to case. in normal javascript I just write this to get the number of total rows of the column document.getElementById(‘hometable’).getElementsByTagName("tr").length-1 unfortunately in cypress i get the following error: document.getElementById(‘hometable’).getElementsByTagName("tr").length-1 VM298:1 Uncaught TypeError: ..

Read more

i tried insert ads using validation system but its give me error Argument 1 passed to IlluminateValidationFactory::make() must be of the type array, object given, called in D:wampwwwpaginationvendorlaravelframeworksrcIlluminateSupportFacadesFacade.php on line 261 AdsController.php public function store(Request $request) { $file = new File($request->all()); $file->user_id = Auth::user()->id; $validator = Validator::make($file->all(), [ ‘category_id’=>[‘bail’,’required’], ‘titre’ => [‘bail’, ‘exclude_unless:category_id,1’, ‘required’, ‘string’, ..

Read more

I am creating a movie series database and have models like so: Series $with=["seasons"] hasMany(AppSeasons) Season $with=["episodes"] belongsTo(AppSeries) hasMany(AppEpisode) Episode belongsTo(AppSeason) Question 1 How can I based on Eloquest Series::all() sort desc by Episode ID ? [ [… seasons: [ [… episodes: [ [id] <—- sort by this ] ] ] ] Question 2 Can ..

Read more