المشاركات

عرض المشاركات من يناير, 2022

Migrations in Laravel 5+

Is there a way to execute migrations on laravel application in order to update current database structure? I use mysql database. I tried to execute php artisan migrate:fresh but it destroys and recreate the whole database structure. How do I avoid it? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/31jUWvF via IFTTT

Laravel 5.8: beberlei/assert/lib/Assert/functions.php return type produces error

I installed Laravel 5.8 on local server it works fine, but on remote server it reports the error Parse error: syntax error, unexpected ':', expecting '{' in /***/vendor/beberlei/assert/lib/Assert/functions.php on line 37 This is the line producing the error function that($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain { return Assert::that($value, $defaultMessage, $defaultPropertyPath); } I think the PHP version can't understand the return type or Scalar type string. The PHP version of the server is 7.3.13 and return type and scalar type sting are valid statement in this version but it still reports the error. Do any of you guys know why does this happen? Thanks in advance from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3b4o7Yi via IFTTT

What guard does laravel uses by default for authentication user in LoginController and RegisterController?

I have made a simple authentication with default laravel configurations. My default guard is set to web guard. 'defaults' => [ 'guard' => 'web', 'passwords' => 'users', ], My authentication works perfectly. Now when I put this route. Route::group(['middleware' => ['auth']], function () { // Users Route::get('users/me', 'UserController@me')->name('users.me'); //...below routes. This route is returning the exception unauthenticated . But when I pass the guard as auth:api here in the middleware, it works. So I just want to know over which guard was my user authenticated. Since default is mentioned is web and I have not added guard() method on laravel to change the guard, why it was not taking the default web one? Is it because it is mentioned in the api routes? And if it is so, how come does it work with auth:api anyway when I have not authenticated my user...

SQl queries are throwing error maria Db Offset Problem laravel php

Recently I have deleted my vendor folder and reinstalled. After that change my all get queries are throwing error. I have no clue what i am missing. Thanks / Error / SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'offset 0' at line 1 My Code: public function couponList(Request $request){ $sort_by = $request->get('sort-by'); $order_by = $request->get('order-by'); $homeTitle = 'Coupons and List'; $coupons = DB::table('sb_coupons AS CO') ->select('CO.*','CO.status as couponStatus','CO.created_at as couponOrderDate','UT.*', 'UT.firstname as userName') ->leftJoin('sb_customer AS UT', 'UT.customer_id', '=', 'CO.user_id'); if(!empty($request->s)){ $co...

AdonisJS - SyntaxError. Unexpected character ' '

I am trying to fetch all talent resource from the database but when I tried the endpoint on Postman, it returned a SyntaxError. Unexpected character '' error. I dont know where that character is coming from as postman hinted that the error is on Line 66 of my controller, but on checking the line 66 is an empty/blank line. What could possibly cause this error? My controller code (the method the API is calling is below) async searchTalent({ request, response }) { try { const params = request.except('projectId'); let matchedTalents = []; let talentIds = []; const {tools, fullname} = params; if(tools) { const find = await Database.raw("SELECT * FROM pro WHERE MATCH tools AGAINST ('"+ tools +"' IN NATURAL LANGUAGE MODE)"); const talents = find[0]; if(talents) { for(let t = 0; t < talents.length; t++) { ...

Laravel add user via admin panel

my goal is add users by myself via admin panel. A form for entering the name, email and password is created. Username, password and email are fields of the same table, is it possible for the form to allow add values via hidden inputs and insert them ​​into different table in the database? The values from hidden inputs will be constant, only in different table than the name, password and email values. from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/31b6Tnr via IFTTT

Issue while trying to Login as admin laravel php

I am trying to setup my local debugging environment for laravel application. Everything was working fine. Today I deleted my vendor folder and did composer install. First I started getting error payload is undefined. After that I am not able to login in the application as admin. This was not happening earlier. I am not sure why this is throwing error. username: admin@admin.com password: admin12345 in DB in hashed format: $2y$10$BgzkwksC4dl8i3IWBGBGLudU1BjvK1giWf7wZeQm7dSOoxkaXfIAG Hash::check($request->password, $admin->password) is always returning false. Here is my Code: public function login(Request $request){ $validation = Validator::make($request->all(), [ 'email' => 'required|email', 'password' => 'required|min:5', ]); if ($validation->fails()) { return redirect()->back()->withErrors($validation)->withInput($request->only('email...

Laravel do i need two controllers to handel two store functions?

Basically what i want to do is that 1 Controller handels two store functions called like this: public function singleupload(){ ..some code } and public function multiupload(){ ..some code too } as i continued to define the routes (get/post) Route::get('/MultiUpload', 'controller@MultiUpload'); Route::get('/SingleUpload', 'controller@SingleUpload'); Route::post('/MultiUpload', 'controller@storeMulti'); Route::post('/SingleUpload', 'controller@storeSingle'); and as i tried to post some data to my database it tells me that there is no 'store' function. So i opened the docs and found this: POST /photos store photos.store So my question is can i create two store functions in one controller or do i have to create a different one so every route has its own controller with its own store function? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GCzRTN via IFTTT

PHP set empty field in database to value

My goal is set value if field is empty. But get "Trying to get property of non-object" error. last_day is empty field, how to assign value 1 ? public function getPointsForExercises(){ $ls = Auth::user()->lessons()->get(); $last_day = Auth::user()->user_settings->last_day; if (empty($user->user_settings->last_lesson)) { $user->user_settings->last_lesson = 1; } from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RN9xgd via IFTTT

Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException thrown with message

I got this error when i tried to make a crud program on Laravel Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message my code : public function update(Request $request){ DB::table('berita')->where('id_berita',$request->id)->update([ 'judul' => $request->judul, 'isi_berita' => $request->isi, ]); return redirect('/berita'); } There is my Routes : <?php Route::get('/index', function () { return view('index'); }); Route::get('/', function () { return view('index'); }); Route::get('halo', function () { return "Halo, Selamat datang di Web Jurusan RPL SMKN 2 Subang"; }); //route CRUD Route::get('/berita','InputController@index'); Route::get('/berita', function(){ return view('berita'); }); Route::get('/galeri', function(){ return view('galeri'); }); Route::get('/post-a...

Laravel's alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony's Response.php in vendor. We have solved this by copying Response.php to a separate folder and using an alias to load that new class instead of vendor's. We did this in AppServiceProvider: public function boot() { AliasLoader::getInstance()->alias('Symfony\Component\HttpFoundation\Response', 'App\Overrides\Response'); ... public function provides() { return ['Symfony\Component\HttpFoundation\Response']; It worked fine until we pushed to production and suddenly it stopped working. While it still works fine on our dev servers. We can clearly see that the original class from vendor is being loaded instead of the one from Overrides so for some reason the alias doesn't work. Does anyone have any clue as to what could cause this? Don't even know where to start or what sorts of settings or artisan commands could have caused this behaviou...

ErrorException controller@comment Not defined

My app in showing this error "Action App\Http\Controllers\ComplainController@comment not defined. (View: /var/www/html/Chirag_Laravel/resources/views/backend/pages/ifa/complaint.blade.php)" But i have already entered the controller and the route funtions properly Controller part: public function comment($id,Request $request) { $user_name=$request->session()->get('user_name'); $ticket=Complaint::Where('id','=',$id) ->SELECT('ticket_no') ->get(); foreach($ticket as $tickets) { $tik=$tickets['ticket_no']; $comments=\DB::SELECT('SELECT comment,comment_by from comments where complaint_id=? AND comment_by=? or comment_by=? ORDER BY id DESC',[$tik,$user_name,'Admin']); return view('backend.pages.ifa.comment',compact('tik','id','comments','user_name')); } } ...

Laravel join from two tables including null

I have 3 tables root, child_1, child_2 . root table: id | child_1_id | child_2_id ...| child_1_id/child_2_id is nullable ! child_1 table: id | child_2_id | name | ...| child_2 table: id | name ...| root table has foreign keys to child_1 and child_2 . The relation for both is one child_1 or child_2 to many roots. child_1 table has foreign key child_2_id and relation one child_2 to many child_1. I want to select everything from child_1 and child_2 and count rows from root table for each child_1/child_2, where I can: foreach($elems as $elem){ } $elems = collection => name=> column from child_1 or child_2 | all => COUNT rows for current child_1/child_2. I am using the latest Laravel version with MySQL. from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RIv2yw via IFTTT

Get attribute from selected model

I am using PHP 7.1.33 and Laravel Framework 5.8.36 . I am getting a model back by name like the following Product::where('name', '=', $name)->get(); My Product model looks like the following: <?php namespace App; use Illuminate\Database\Eloquent\Model; class Product extends Model { /** * The table associated with the model. * * @var string */ protected $table = 'product'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['name', 'url', 'category']; } When trying to get an attribute like the following I get an error: $product = Product::where('name', '=', $name)->get(); $product->$url; // ERROR $product->$category; // ERROR Any suggestions how to access the attributes on my retrieved model? I appreciate your replies! from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2uL9KaA via IFTTT

Pdf Report and Receipt generation in laravel 6.2?

Currently I am doing a project concerning student management..in my project there is features involve with payment of tuition fees and books sold to a student... What i need is to print receipt to both of them and generating a monthly and daily reports.. Can any one help which way or package should i use to perform those operations with print page of half A4 and good looking receipt? Help me!! I tried on DomPdf but it failes to load grid system of bootstrap 4 and jimmy/laravel generator report it brings error on installing in laravel 6.2? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/38TES6w via IFTTT

Laravel 6.x : Update method in UserController

Hello everyone I allow myself to come to you because I am faced with a problem indeed when I want to implement the update method in my user controller it does not work I explain two. When I go to my edition view of wrestling games, my data is good but when I modify it and send it nothing happens I just come back to a page with a message telling me that my data is up to date in my table no update data I join my controller saw me and my routes Controller : public function update(Request $request, User $user) { // $user = User::findOrFail($id); $request->validate([ 'firstname' => 'required', 'name' => 'required', 'email' => 'required', 'usertype' => 'required', ]); $user->update($request->all()); return redirect('/role-register')->with('status', 'The account is update !'); } Edit view : <div class="container"> <div class="row"...

LDAP Configuration Laravel5 - Authentication user provider [adldap] is not defined

I'm fresh beginner in Laravel 5.8 and i'm trying to develop an app with LDAP authentication. I use this package : https://adldap2.github.io/Adldap2-Laravel/#/auth/setup And i got this error : Authentication user provider [adldap] is not defined. Does anyone know this error and could tell me where my configuration can be wrong ? Thansk for your help :) from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RCy6fv via IFTTT

can someone teach me about this mock test step by s

صورة
How to make the "PodcastwasPurchased"? What is the output of this mocking test? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2taFLZ3 via IFTTT

Join and OrderBy within with laravel eloquent query

I want to display ordered list of stores based on cities from a brand. This is the code I tried $brand = Brand::where('slug','=',$slugurl) ->with(['stores' => function($q){ $q->where('status', 1) ->join('cities', function ($join){ $join->on('cities.id', '=', 'stores.city_id')->orderBy('cities.sort_number', 'DESC'); }); }]) ->firstOrFail(); The relationship of the tables : Brand hasMany Stores and Stores belongTo Cities The listings results output is not ordered based on cities sort_number. Any idea how to achieve this ? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RFXIIz via IFTTT

Redirect in Laravel .htaccess

I am beginner in Laravel. I use in my project Laravel 5.8. I make new website (old website was delete) I have .htaccess: <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Redirect to https RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://domain.pl/$1 [R,L] # Redirect to non www RewriteCond %{HTTP_HOST} ^www.domain.pl$ [NC] RewriteRule ^(.*)$ https://domain.pl/$1 [R=301,L] # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] # Fonts # Add correct content-type for...

ldap_sasl_bind showing Unknown authentication method in laravel

I am trying to implement LDAP in laravel 5.8 (PHP 7.2). I am getting issue while call ldap_sasl_bind method, its showing me error "Unknown authentication method". I am able to login with LDAP admin with choosing option GSS-API and SASL. Please help me to get resolve this issue. from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2UatPSe via IFTTT

Laravel resource route is not updating in database using

Laravel resource Route is not updating when i click update button, but it has store at same process. I am using data-toggle="modal" for updating my value, but it is not update my category? Where exactly my problem? i check my id is passed properly, but it is not going to my update controller function. i check using dd($request->all()); in my update function in controller. my route is Route::resource('/mother-category', 'MotherCategoryController'); my update and store function is public function store(Request $request) { $validator =Validator::make($request->all(), [ 'mother_name' => 'required', ]); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } MotherCategory::insert([ 'mother_name'=>$request->mother_name ]); return redirect()->back()->with('message','Mother Categor...

How to increase security of a Laravel site

صورة
I am a beginner in Laravel. I have a live project(ex: https://seniorcitizenhospital.com/ ) made with Laravel. But while I use site::https://seniorcitizenhospital.com/ in google search engine for security checking it gives me a search result like below image I can't understand how to remove these from my site. Anybody Help Please? Thanks in advance from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2U7j3fu via IFTTT

How Laravel Create a new Contract class file and Service class File

I want to create a member login for one portal to another. Currently I created a ProviderClass. So I am going to develop that as a service. In my laravel folder structure there is no any folder to 'Services' and 'Contracts'. How create a service and contract class. from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/36EebAY via IFTTT

how can i submit the employee table id (auto increment) to the user table under the employee_id on form submit

public function store(Request $request) { Employees::create([ 'first_name'=>$request['first_name'], 'last_name'=>$request['last_name'], 'email'=>$request['email'], 'contact_no'=>$request['contact_no'], 'join_date'=>$request['join_date'], 'date'=>$request['date'], 'employee_no'=>$request['employee_no'], 'no'=>$request['no'], 'profile'=>$request['profile'], 'dob'=>$request['dob'], 'leave_eligible_date'=>$request['leave_eligible_date'], 'leave_eligible_date'=>$request['leave_eligible_date'], 'employee_type_id'=>$request['employee_type_id'], 'employee_designation_id'=>$request['employee_designation_id'], ...

Not delete image from laravel backpack 4.0

I'm using image field in laravel backpack 4.0, it upload image without problems. When I delete it from 'delete button', it delete register, but not image file from my local folder. I'm checked the answer from backpack for laravel deleting image , but It no fix my issue. My config/filesystem: 'disks' => [ 'local' => [ 'driver' => 'local', 'root' => storage_path('app'), ], 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ], 's3' => [ 'driver' => 's3', 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT...

Wrong object type: 7 ERROR: WITHIN GROUP is required for ordered-set aggregate mode in laravel

hello all I have a problem here message from sentry.io ERROR: WITHIN GROUP is required for ordered set set aggregate mode, I develop in production and production with the same code, in develop there are no problems that occur but in production there are errors like that Is it because of the database version difference or because my code has an error? $vendor = DB::table('master.vendor_client as cv') ->leftJoin('master.vendor as fv','fv.id','=','cv.vendor_id') ->select('cv.*','fv.name','fv.mode','fv.vendor_type') ->orderBy('cv.id') ->get(); from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2O5095d via IFTTT

SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "user" does not exist in Laravel app

I did my research and none of the available solutions worked. I am having the following issue: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "user" does not exist LINE 1: select * from "user" where ("email" = $1 or "user" = ... ^ (SQL: select * from "user" where ("email" = david.guzman@company.mx or "user" = david.guzman or "email" = david.guzman) and "user"."deleted_at" is null limit 1) I am having this error only in my server. I have dropped the database, created and excecuted migrations, all the tables are created with their relations. I seed my database correctly and can even run queries in the psql terminal. User does exists, with all it's columns. I did the same process in my local machine and it works perfectly. It actually started failing after y dropped the database and dropped the public schema and created it again. I think it may be a problem with postgres since it w...

UpdateOrCreate with model instance

I am using PHP 7.1.33 and Laravel Framework 5.8.36 . I am getting receiving data from a database row-by-row and I am creating a model using updateOrCreate() like the following: foreach ($arr as $v) { $product = new Product(); $product->name = $v['name']; $product->url = $v['url']; $product->price = $v['price']; // save $matchThese = ['name' => $name, 'url' => $url]; $product->updateOrCreate($matchThese); } However, nothing gets created. Any suggestions what I am doing wrong? I appreciate your replies! from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/36BoK89 via IFTTT

How to send email by gmail in Laravel

how to send gmail email in larave, im very tired in this error, please help me this is my .env file my env file this is may error image email error from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2U6109r via IFTTT

Install mpdf or dompdf issue on laravel 5.2

I am trying to add dompdf on my laravel project using command- composer require barryvdh/laravel-dompdf: 0.7.0 after installation i get error: > [2022-01-29 17:45:54] local.ERROR: UnexpectedValueException: The > Response content must be a string or object implementing __toString(), > "boolean" given. in > D:\xampp\htdocs\mykidreport\vendor\symfony\http-foundation\Response.php:399 > Stack trace: > #0 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Http\Response.php(56): > Symfony\Component\HttpFoundation\Response->setContent(false) > #1 D:\xampp\htdocs\mykidreport\vendor\symfony\http-foundation\Response.php(201): > Illuminate\Http\Response->setContent(false) > #2 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1085): > Symfony\Component\HttpFoundation\Response->__construct(false) > #3 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispa...

Notification Laravel

i want to make notification in laravel using ajax and get data from controller but i don't know why this always said 500 internal server error this is my ajax $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); $(document).ready(function(){ // updating the view with notifications using ajax function load_unseen_notification(view = '') { $.ajax({ url:"notif", method:"POST", beforeSend: function(xhr){xhr.setRequestHeader('X-CSRF-TOKEN', $("#token").attr('content'));}, data:{view:view}, dataType:"json", success:function(data) { $('.dropdown-menu').html(data.notification); if(data.unseen_notification > 0) { $('.count').html(data.unseen_notification); } ...

Laravel 5.8 - How to dump parameters from controller in the view

I'm fresh beginner in the PHP Framework Laravel (i'm using version 5.8), and i would like to dump all the variables of a controller from a view. Is that possible to do that ? Thanks for your help :) from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RV3Xae via IFTTT

Crawler + Guzzle: Accessing to modal popup values

I am new on LinkedIn and how to scrap modal popup values using Guzzle and crawler. enter code here $url1=' https://www.linkedin.com/in/xxxxxxxxx/ ';$crawler1 = $client->request('GET',$url1);$crawler1->filter('.render-mode-BIGPIPE')->each(function ($node) use ($url1) {print $filternode=$node->text()."\n";}); from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GzxDVa via IFTTT

how to submit form Automatically, when it time is up?

Am trying to soft delete the post when the timeout, but unable to do that automatically..! Here's My Code: @php $date=str_replace('-', '/', $post->created_at); $endDate=date('Y/m/d H:i:s',strtotime($date. ' + '.$post->post_days.' days')); @endphp @if($endDate == 0) <form action=""> <input type="text" name="postId" value=""> <button type="submit" >test</button> </form> @endif from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GA6Bgd via IFTTT

How can i write accessor methods for created_at or updated_at in Laravel 5.8?

I made two accessors like below code, but while fetching it is not showing what is being passed in accessors for created_at & updated. /** * This will change date according to timezone. * @param String path */ public function getCreatedAtAttribute($value) { return $this->changeDateFormUTCtoLocal($value); } /** * This will change date according to timezone. * @param String path */ public function getUpdatedAtAttribute($value) { return $this->changeDateFormUTCtoLocal($value); } But this is not working. While other accessors are working which are following camelCase convention. Personally i assume it as an case issue. I think laravel assumes attributes as camelCase. What can be the solution ? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3aOdIzz via IFTTT

laravel delete multiple record from different database at once

I want delete two record from different table with one delete function. however it is only deleting one of the record even though I passed two different Ids. this is my delete function public function delete($id){ $user_id = auth() ->user()->id; $card = Card::where('id', $id)->delete(); $actCity = city::where('id', $id)->delete(); return redirect('/home')->with('success', 'Post Removed'); this is my delete button @if (!empty($cardd && $actCity)) {!!Form::open(['action'=>['PlanController@delete','id' =>$cardd[0], 'id'=>$actCity[0]],'method'=>'POST','class'=>''])!!} @endif {!! Form::submit('Delete', array( 'class' => 'btn btn-danger', 'onclick' => "if( ! confirm('Are you sure you want to delete your package?')){return false;}" )) !!} {!! Form...

Conflicts between boostrap css and tailwindcss in laravel 5.8

i have Installed la-ravel 5.8 with bootstrap. Then i installed tailwindcss and i tried using the prefix 'tw-' to separate the classes. After compiling npm run dev the page is not displaying properly because of the conflicts between the classes you used. How best can i handle this https://redesign-worklog.doegel.de/ from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RZ33cU via IFTTT

laravel + react not loading React's stuff with localhost (without php artisan serve)

Is it possible to run Laravel + react with some thing like http://localhost/projectfolder/public without php artisan server Thanks from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RXKkhL via IFTTT

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a que páginas entra, si ingresa, edita o elimina un registro, cuales repirte visualiza Todo lo que encuentro es laravel logging, pero dirigido a errores, no a actividad de los usuarios. from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RCOTz7 via IFTTT

Clear SessionStorage or localStorage after form submit not working

I am using laravel 5.5 created a quiz form where user can enter his answer and submit. user will have max duration when it reaches 0 the form will automatically submit. I used sessionStorage to store the timer so that the timer won't reset on page refresh, but the problem is sessionStorage is not clearing after the form submit. <span id="divCounter" class="label label-success timer">00 Hrs : 00 Mins : 00 Secs</span> <script type="text/javascript"> //Set Time To Session Storage if (sessionStorage.getItem("timerStorage<?php echo $singleData->id; ?><?php echo Auth::id(); ?>")) { if (sessionStorage.getItem("timerStorage<?php echo $singleData->id; ?><?php echo Auth::id(); ?>") == 0) { var timer = <?php echo $singleData->duration; ?>; } else { var timer = sessionStorage.getItem("timerStorage<?php echo $singleData->id; ?><?php echo Auth::id(); ?>"); ...

How to make autofill into add/remove field dynamically using jquery?

I am doing a program using laravel. I use add/remove field with jquery. The first field grab the data from database to list out the person's name. <div class="container table-responsive col-lg-10"> <form method="post" id="dynamic_form"> <span id="result"></span> <table class="table table-hover table-responsive table-bordered" id="user_table"> <thead> <tr> <td class="text-center col-lg-3">Nama</th> <td class="text-center col-lg-2">No Personal</th> <td class="text-center col-lg-1">Jabatan</th> <td class="text-center col-lg-1">Telefon</th> <td class="text-center col-lg-1">Ext</th> <td class="text-center col-lg-1...

Multiple Request with Guzzle in Laravel

I've restapi with pagination and I need to combine the result for sitemap. Json Results { ... "info": { "playlistId":"PLxxxxx", "totalResults": 242, "maxResults": 50, "nextToken": "CCAAQ" }, "results": [ { "id": 1, "title": "How to make a Cookies", } ... ] } I've trying with below code, but still no luck. lot of duplicate video. I don't know what's wrong with this. I've try use promise too, but the results still duplicated. ... $requests = []; foreach ($playlists['playlistId'] as $playlistId) { if (!empty($playlistId)) { $result = $client->request('GET', route('api.playlist', ['playlistId' =...

How to call PHPCap external package in laravel 5.5

I need to use the below package in Laravel 5.5 it's an external package. https://github.com/iuredcap/phpcap I download zip from above the GitHub URL and phpcap directory added in Laravel 5.5 vendor folder. and use below code and in my controller. use \IU\PHPCap\RedCapProject; OR use IU\PHPCap\RedCapProject; and Call below function in my action $project = new RedCapProject($apiUrl, $apiToken); But every time given below error. Class 'IU\PHPCap\RedCapProject' not found from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GwJYt7 via IFTTT

Assert Laravel Command is Called in Test

I call Laravel commands from a Laravel command. It works, but I want to test if the subcommands A and/or B are called . Below a simplified version: final class HandleActions extends Command { public function handle() { foreach ($items as $item) { if ($item->price * 2.24 > 100) { $this->call('order:reprocess'); // command A } if (!$item->stock) { $this->call('order:cleanup'); // command B } } } } I test this command like so (simplified), so I know that the main command is excited successfully. $this->artisan('command')->assertExitCode(0); // How do I assert command A is fired? // How do I assert command B is fired? I want to assert that subcommand 1 is fired and/or subcommand 2 fired. But how to do this? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3aMtlYm via IFTTT

Laravel - null value is returned from the database

I get "is null" value from column in database, how to figure out why ? controler: public function getValues(Request $request) $node_id = floor($day); $sub_id = $day; $mtime = $request->mtime; $silent_data = Auth::user()->lessons()->where('mtime',$mtime)->where('sub_id',$sub_id)->where('node_id',$node_id)->first(); table lessons: id int(10) user_id int(10) node_id int(10) sub_id varchar(191) mtime int(10) laravel console: select * from `lessons` where `lessons`.`user_id` = 11382 and `lessons`.`user_id` is not null and **`mtime` is null** and `sub_id` = '1.4' and `node_id` = 1 table lessons column mtime has value 10 from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/38NBzha via IFTTT

UnexpectedValueException: The Response content must be a string or object implementing __toString(), "boolean" given

Getting error after installing dompdf [2022-01-28 18:23:03] local.ERROR: UnexpectedValueException: The Response content must be a string or object implementing __toString(), "boolean" given. in D:\xampp\htdocs\myproject\vendor\symfony\http-foundation\Response.php:399 from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3115vUh via IFTTT

How can I convert many statement mysql dinamis to laravel eloquent?

Mysql query like this : SET @sql_dinamis = ( SELECT GROUP_CONCAT( DISTINCT CONCAT('SUM( IF(id_barang=',id_barang,',jml_bk,0)) AS br',id_barang)) FROM barang_keluar ); SET @SQL = CONCAT('SELECT month(tgl_keluar) as m,',@sql_dinamis,' FROM barang_keluar WHERE month(tgl_keluar) and year(tgl_keluar)=2022 GROUP BY month(tgl_keluar)' ); PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt; I want to convert it to laravel eloquent, but i'm confused. Because there exist many statement. There exist PREPARE, EXECUTE, SET, DEALLOCATE etc. You can see query above How can I convert it to laravel eloquent? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Gxhcsi via IFTTT

Google Drive API list all occurances of the folder

I am using Google Drive API client for Laravel and I am trying to list the folders by query filters. $scope = Config::get('options.gdrive_scopes'); putenv('GOOGLE_APPLICATION_CREDENTIALS=' . base_path() . DIRECTORY_SEPARATOR . 'gdrive_atdnj.json'); $user = Config::get('options.google_drive_user_name'); $client = new \Google_Client(); $client->useApplicationDefaultCredentials(); $client->setApplicationName(Config::get('app.name')); $client->setScopes($scope); $client->setAccessType('offline'); $client->setSubject($user); $service = new \Google_Service_Drive($client); $files_to_be_uploaded = Storage::files('orders/' . $orderId); $project_folder_filters = array( 'fields' => 'files(id)', 'q' => "name contains '" . $project_folder_name . "' and mimeType='application/vnd.google-apps.folder'", 'supportsAllDrives' => true, 'includeItemsFr...

Laravel 5 return redirect is not working as it should

I'm having a controller with some functions. In every function I get user data by sharing it from the Contoller.php In controller.php public function share_user_data() { $user = Auth::user(); $this->checkValidation($user); $this->user = $user; View::share('user', $user); } public function checkValidation($user){ if($user->email_activated == 0){ var_dump($user->email_activated); // I get: int(0) return redirect('/verifyEmail'); } } In the other controller public function viewCategory(Category $category){ $this->share_user_data(); // here's the check $this->get_site_lang(); $products = $category->products; return view('category', compact('category','products')); } But I get the category view and not redirected to the verifyEmail route. How to fix this and why it's happening? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/36xnPFL via IFT...

How hard/easy is it to convert this to CodeIgniter 3?

صورة
I lately used FreeScout and think its " System Status " page is pretty neat. Thats why I want to make my own for another project. As FreeScout is based on Laravel but the other project is based on CodeIgniter 3 where are some differences. Also you should know I modified the Screenshot (deleted some parts which I do not need). What would be required: Info: TimeZone that is beeing used Protocol Web Server PHP Version PHP Extension: gd hash json mbstring mysqli openssl recode xmlrpc zlib Permission: (775) Folder Path 1 Folder Path 2 Folder Path 3 Cron: Last time run of cron Do some of you guys already have some experience with creating " System Status " or " System Info " pages for CodeIgniter 3 or PHP 7 at all? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/30ZbEQO via IFTTT

Laravel migration fails with SQLSTATE[HY000]: General error: 1215

I'm trying to add a migration with laravel. This is mi migration file. public function up() { Schema::create('sl_categories', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('title')->nullable(); $table->integer('user_id')->unsigned()->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->softDeletes(); $table->timestamps(); }); Schema::create('sl_images', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('image')->nullable(); $table->integer('sl_category_id')->unsigned()->nullable(); $table->integer('display_order')->nullable(); $table->softDeletes(); $table->timestamps(); }); Schema::table('sl_images...

Laravel: Login form "Remember Me" functionality not working

One of my website is developed in Laravel, it was working fine before. What does is I want to move website from beta.example.com to example.com so I have pointed to beta with original domain name(example.com). The Website is working fine but all remember me functionality is not working. Now Users have to enter the password and also if they check the check box (remember me) still it does not store the password in cookies or session. Please help me. Thank you from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2O73gcL via IFTTT

How would I get no of sends & no of opens for push notification using FCM APIs?

I am sending push notification on Android & IOS app using FCM API of firebase which is https://fcm.googleapis.com/fcm/send When I send push notification from dashboard It gets received on user's mobile phone. I wanted to keep track of no of sends & opens of push notification. Thanks! from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/37zPya6 via IFTTT

I'm using single ip with multiple port number for laravel frontend and backend. e.g 123.23.5.1:89 and 123.23.5.1:90

I just want know that how I can use Laravel asset() and url() function to return url with port number. currently both the function returns http://123.23.5.1 But I want full address like this http://123.23.5.1:89 Can you please help me? Thanks in advance. from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GwWE37 via IFTTT

Trying to get property 'id' of non-object in demo.blade.php

Hi I am working on the checkout page in laravel and sent some product data from the cart to checkout and trying to print all the details from an json object but i keep getting the error as Trying to get property 'id' of non-object The controller function is public function bill(Request $request){ $input = $request->all(); return view('demo')->with('product' , $request->product) ->with('subtotal' , round($request->subtotal)); } the cart form is <form method="post" action=""> @foreach($cart as $product) <input type="hidden" name="product[]" value=""> @endforeach <input type="hidden" name="subtotal" value=""> ...