Error laravel 5.8 installing package (Installation failed, reverting ./composer.json to its original content.)

enter image description hereUsing version ^8.0 for laravel/passport ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 – Conclusion: remove laravel/framework v5.8.35 – Conclusion: don’t install laravel/framework v5.8.35 – laravel/passport 8.x-dev requires illuminate/support ^6.0|^7.0 -> satisfiable…

Call to a member function addDays() on string on Laravel 6

I have a store function , in store function is want to create a date format using carbon . so u can see this code here public function store_cuti(Request $request) { $end = $request->tgl_mulai->addDays(3); $users = new Data_cuti; $users->user_id = $request->user_id ; // users_id $users->nama_surat = $request->nama_surat ; $users->tgl_surat = $request->tgl_surat ; $users->durasi_cuti = $request->durasi_cuti…

Laravel API Resource doesn’t work in Controller Method

My Post Model has the following format: { “id”: 1, “title”: “Post Title”, “type: “sample” } Here is my controller method: public function show($id) { $post = App\Post::find($id); $transformedPost = new PostResource($post); return $transformedPost; } Here is how my PostResource looks: public function toArray($request) { return [ ‘id’ => $this->id, ‘name’ => $this->title, ‘type’ =>…

Error laravel 5.8 installing package (Installation failed, reverting ./composer.json to its original content.)

enter image description hereUsing version ^8.0 for laravel/passport ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 – Conclusion: remove laravel/framework v5.8.35 – Conclusion: don’t install laravel/framework v5.8.35 – laravel/passport 8.x-dev requires illuminate/support ^6.0|^7.0 -> satisfiable…

Laravel detach not working on belongsToMany

I have this model: Company Wich has a relation: $this->belongsToMany(‘App\CallList’, ‘call_list_companies’, ‘company_id’, ‘call_list_id’) And vice versa: CallList Relation: $this->belongsToMany(‘App\Company’, ‘call_list_companies’, ‘call_list_id’, ‘company_id’) I am able to attach a Company to the CallList But i cannot detach a Company from a CallList Why is that? The code I use for detaching the Company: $company->call_lists()->detach($call_list); I also…

How to download an attachment from Outlook API with PHP Laravel?

I want to download an attachment. I have reached to attachment with the request: /me/message/{message_id}/attachments/{attachment_id} Response is: [_propDict:protected] => Array ( [@odata.context] => https://graph.microsoft.com/v1.0/$metadata#users(‘username’)/messages(‘messageId’)/attachments/$entity [@odata.type] => #microsoft.graph.fileAttachment [@odata.mediaContentType] => application/vnd.openxmlformats-officedocument.spreadsheetml.sheet [id] => xxx [lastModifiedDateTime] => 2019-11-02T17:50:52Z [name] => xxx.xlsx [contentType] => application/vnd.openxmlformats-officedocument.spreadsheetml.sheet [size] => 33459 [isInline] => [contentId] => f_k2hv435z0 [contentLocation] => [contentBytes] => GuzzleHttp\Psr7\Stream…

How to create javascript function in laravel foreach loop

I need some help about this code I have some code in blade view @foreach($cart as $ct) <button type=”button” id=”edit” class=”btn-btn-delete”> <i class=”mr-1 fas fa-edit”></i>Edit </button> //when I at this point, it return id of current product <div class=”form-popup” id=”myForm”> //however, when I at this point, it return id of the last product <form action=””…