Category : laravel-5.8

I make many database applications, in my database have the same table name and the same file. how can i display all the data this is my model this ins my model users class Users extends Model { // protected $connection = ‘mysql4’; protected $table = (‘ilkom_akbar.table_users’); protected $primaryKey = ‘ID’; protected $fillable = [‘ID’,’user_login’,’user_pass’,’user_nicename’, ..

Read more

Hey m trying to use The client credentials grant for machine-to-machine authentication. i followed all the steps here but that all wt m getting { "error": "unsupported_grant_type", "error_description": "The authorization grant type is not supported by the authorization server.", "hint": "Check that all required parameters have been provided", "message": "The authorization grant type is not ..

Read more

i have a laravel application that sends email and sms through Notification, but a page was created with a form, where it would be necessary to get the email from the form’s input to send the information my controller public function store(Request $request) { $request->validate([ ‘responsible_service’ => ‘required’, ‘company’ => ‘required’, ‘responsible_company’ => ‘required’, ‘responsible_contact’ ..

Read more

<?php namespace AppHttpControllers; use IlluminateHttpRequest; class HomeController extends Controller { protected $layout = ‘layouts.master’; public function dashboard(){ $this->layout->content = view(‘dashboard.index’)->withTitle(‘Dashboard’); } } sorry, here I followed the tutorial in laravel 4 and I implemented it at level 5.8 (with references in the document laravel 5.8). in implementation, I get the error message "Attempt to assign ..

Read more

When trying to format date with laravel accessor everything works fine. public function getDueDateAttribute($value) { return Carbon::parse($value)->format(‘d-m-Y’); } But when I use Laravel Voyager BREAD Browse accessor public function getDueDateBrowseAttribute($value) { return Carbon::parse($value)->format(‘d-m-Y’); } I get the following error: ErrorException(code: 0): Data missing at vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:594 Sourc..

Read more

I have database table structure like : ClassRoom id (int) PK name (varchar) ClassTeacherCourse id (int) PK id_classroom (int) FK id_teacher (int) FK id_course (int) FK Course id (int) PK course_name (varchar) Teacher id (int) PK teacher_name (varchar) So far I have code just to call ClassRoom table & ClassTeacherCourse, like : $class = Class::where(‘id_teacher’, ..

Read more

command: composer require laravel/scout -W error: Using version ^8.4 for laravel/scout ./composer.json has been updated Running composer update laravel/scout –with-all-dependencies Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 – Root composer.json requires laravel/framework 8.2.*, found laravel/framework[v8.2.0] but it conflicts with another ..

Read more

I want to add search engine on my website and I want to use elasticSearch. I’m using it for my first time and it gives me this error "error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: my code looks like this: web.php use AppPosts; Route::get(‘/elasticSearch’, function(){ Posts::createIndex($shards = null, $replicas = null); Posts::putMapping($ignoreConflicts = true); Posts::addAllToIndex(); }); ..

Read more

HTML Code @foreach($posts as $post) <div class="container card mt-2" style="width: 32rem;"> <img src="{{ asset(‘images’)."/".$post->img_url }}" class="card-img-top" alt="img not found"> <div class="card-body"> <h5 class="card-title">{{ $post->champion }} </h5> <p class="card-text">{{ $post->owner_user->username }}</p> </div> </div> @endforeach Laravel code public function testpage() { return Posts::with([‘OwnerUser’,’like’])->get(); } when I just return Posts table, it has column owner_user with user information ..

Read more

I’m in Laravel 5.8 in Windows trying to create an inbound API route. Postman always gives me a 404 when I try to hit this route: http://MYHOSTISHERE/api/v1?event=NewDealerSetUp&api_key=MYKEYISHERE CURL with curl -X POST "http://rx-0-unicorn.local/api/v1?event=NewDealerSetUp&api_key=MYAPIKEYHERE" also gives me a 404. Can someone point me to what I’m doing wrong? I’m bald but I may start pulling out ..

Read more