Category : laravel-5

I’m trying to make a custom forgot password but when I’m trying to send the email it gives this error Argument 1 passed to AppHttpControllersAuthPasswordController::AppHttpControllersAuth{closure}() must be an instance of IlluminateMailMessage, instance of AppModelsUser given, called in D:laragonwwwlaravel8vendorlaravelframeworksrcIlluminateAuthPasswordsPasswordBroker.php I’ve tried with these two methods $response = Password::sendResetLink($request->only(’email’), function (Message $message) { $message->from(‘[email protected]’, Config::get(‘APP_NAME’)); $message->subject($this->getEmailSubject()); }); ..

Read more

I am using maatwebsite to export the records to CSV file. Using php laravel for backend. Here is my following code: Controller code: public static function exportCsvReport($params){ header(‘Content-Encoding: UTF-8’); header(‘Content-type: text/csv; charset=UTF-8’); return Excel::download(new UsersExport, ‘invoices.xlsx’); } UserExport model: <?php namespace AppExports; use AppModelsApiv1Tbcall; use MaatwebsiteExcelConcernsFromCollection; class UsersExport implements FromCollection { public function collection() { ..

Read more

I am getting error Call to undefined method AppHttpControllersProfilesController::authorize() in Laravel 5.8xx but I think I am doing everything right. Controller: public function edit(User $user) { $this->authorize(‘update’, $user->profile); return view(‘profiles.edit’, compact(‘user’)); } Profile Policy public function update(User $user, Profile $profile) { return $user->id == $profile->user_id; } Sourc..

Read more

I wanted to apply some condition in foodOrders. Is it possible to apply condition inside map function that acts as where $foodOrder->foodOrders->where(‘invoice_id’,null)->get(); public function getTableList(Request $request){ $skip =$request->skip; $limit=$request->limit; $totaltable = Table::get()->count(); $table = Table::skip($skip)->take($limit)->orderBy(‘id’, ‘DESC’)->get(); $table->map(function($foodOrder){ $foodOrder->foodOrders; }); } Below is the output that this query returns. But I only want the data with ..

Read more

For now i need to declare in laravel model like that protected $fillable = [ ‘object_name’,’attributes’,’item’,’cost’,’status’,’category’,’object_id’,’status’,’customer_id’,’provider_id’ ]; after that, I can insert value in the database. Is there any way that can make all columns of every newly created table fillable so I will need to change it every time. Sourc..

Read more

@foreach($data as $var) <tr> <td style="text-align:center;"> <input type="checkbox" id="select" class="sub_chk" data-id="{{$var->id}}" value="{{$var->id}}" name="selected_values[]"/> </td> <td>{{$var->id }}</td> <td>{{$var->name}}</td> <td>{{$var->email}}</td> <td> <?php $elements = array(); ?> @foreach($var->student_registrars as $category) <?php $elements[] = ‘<a href=" ‘.route(‘student-registrars.show’, $category->id).’ "> ‘.$category->name.’ </a>’; ?> @endforeach <?php echo implode(‘,<br>’, $elements); ?> </td> <td> // Second foreach should be here </td> <td> <a ..

Read more

@foreach($data as $var) <tr> <td style="text-align:center;"> <input type="checkbox" id="select" class="sub_chk" data-id="{{$var->id}}" value="{{$var->id}}" name="selected_values[]"/> </td> <td>{{$var->id }}</td> <td>{{$var->name}}</td> <td>{{$var->email}}</td> <td> <?php $elements = array(); ?> @foreach($var->student_registrars as $category) <?php $elements[] = ‘<a href=" ‘.route(‘student-registrars.show’, $category->id).’ "> ‘.$category->name.’ </a>’; ?> @endforeach <?php echo implode(‘,<br>’, $elements); ?> </td> <td> // Second foreach should be here </td> <td> <a ..

Read more

I have installed laravel recently via composer but in browser it shows these errors Warning: require(D:xampphtdocslaravel-8.xvendorcomposer/../symfony/deprecation-contracts/function.php): failed to open stream: No such file or directory in D:xampphtdocslaravel-8.xvendorcomposerautoload_real.php on line 69 Fatal error: require(): Failed opening required ‘D:xampphtdocslaravel-8.xvendorcomposer/../symfony/deprecation-contracts/function.php’ (include_path=’D:xamppphpPEAR’) in D:xampphtdocslaravel-8.xvendorcomposerautoload_real.php on line 69 Sourc..

Read more

First time working on pipelines and CI in general so I may stuff that are wrong. I was trying to build a pipeline to automate deployment for our project on CPanel (Don’t ask me, client already had that setup when I joined). Here’s what our bitbucket-pipelines.yml file looks like atm: image: php:7.3-fpm pipelines: branches: staging: ..

Read more

My Laravel app is really very slow, it takes more than 3 seconds to get a response, sometimes less. even if I tried to call a route with an empty controller the time to get the response is 3 seconds. My controller: function index(Request $request){ echo "hi"; exit; } response time Sourc..

Read more

i want to echo ouptut from controller When i dump this object i get all data like i want, but how to echo that I want to display this data like this Here is my controller ` $pkm = DB::table(‘magacin_pkms’)->select( ‘magacin_pkms.status’, ‘magacin_pkms.izdao_to’, ‘users.name as izdaoFirstName’, ‘users.lastname as izdaoLastName’, ‘magacin_pkms.vrednost’, ‘magacin_pkms.izdao_by’, ‘magacin_pkms.izdao_at’ ) ->join(‘users’, ‘id_user’, ‘izdao_to’) ..

Read more

I’m trying to validate date time through Laravel Validation like this: $this->validate($request,[ ‘DateTime’=> ‘required|after_or_equal:’ . date(‘Y-m-d H:i:s’), ]); I want to restrict the user if they enter date time greater than current date time but in my case date is being validated but i have to validate time also. Format of date time is 2020-12-23 ..

Read more

I can send mail from local without any errors but dont send email from VPS. Expected response code 250 but got code "550", with message "550 Bad HELO – Host impersonating domain name [golrizpaper.com] " .env file: MAIL_DRIVER=smtp MAIL_HOST=mailservice4.irandns.com MAIL_PORT=25 [email protected] MAIL_PASSWORD=’******’ MAIL_ENCRYPTION=null Any idea how to solve this? Sourc..

Read more

I’m using vue-social auth package for google login Link: https://www.npmjs.com/package/vue-social-auth As i press the login button i’m getting: [Vue warn]: Error in v-on handler: "Error: Request handler instance not found" Here is the way i’m using it: app.js import VueSocialauth from ‘vue-social-auth’ Vue.use(VueSocialauth, { providers: { google: { clientId: ‘XXXXXXXXXX.apps.googleusercontent.com’, redirectUri: ‘auth/google/callback’ // Your client ..

Read more