Hello,
I am super new to Livewire, making my first component.
I can't seem to get the following part to work: wire:click="changeImage('{{ $media->getUrl() }}')"
A user should be able to click the small gallery image, and this will then...
I'm building a Laravel 8 app that will accept input through a form then send & receive (json) data using multiple external apis. I've done a lot of research on specific functionality such as using Guzzle 7 and the HTTP client in Laravel. I have a...
I am currently storing perPage data in the sessions and partially loading the data based on the perPage value selected. The problem is, I have set my prop type as number, but when the perPage data is being stored in the sessions, it is being stored a...
I want to retrieve all users that have role_id 2 and doesnt relate to workplace with id 3 so i can attach them later to this workplace with id 3.
Users with id 11 and 12 are in relationship to workplace with id 4.
Users with id 13 and 14 are in relat...
Hello, I am moving an application from monolithic to microservices approach in Lumen, in the monolithic app I have orders table and products table with a one to many relationship between them.
Now in a microservices approach it's reasonable to have d...
draw schedules based on logins with data conditions like this
schedules
mapel_id
user_id
room_id
hours_start
hours_end
rooms
name
keahlian
if I use the code below
Room::with('schedules')->get();
Where do I put the user_id in scheludes
and i tr...
Hi,
I've been tearing my hair out for more than a day on an SQL query that I can't formulate with Eloquent ... It's dramatic.
When I write this :
$categories = DB::select(DB::raw("
SELECT categories.*, FLOOR(count(*) * 100 / {$nbFollowers}...
I need to know the best way to define relations and indexes,
Are there any difference between
$table->unsignedBigInteger('example_id')->index();
OR
​$table->index(['example_id']);...
I am trying to create an endpoint and send the data to then endpoint and requesting it later within the controller method. As the input value changes, it fires axios put method and pass the updated perPage data to an endpoint, I am getting a successf...
Hi there, I don't really know how to show the records that are only created today... Can someone help please?
So I have a list of children and each child has a checkin and checkout, what I would like is to show only the checkins and checkouts that ar...
i am using the spatie role manager with laravel v7, i am using a factory to generate dummy data. how do i give a role to the generated data when i create it?
my factory
$factory->define(User::class, function (Faker $faker) {
return [
'...
I have ListCategory , in Category model i code like this,
public function getRouteKeyName()
{
return 'slug';
}
}
in route web.php
Route::get('/list-loker/{$category}', '[email protected]_category')->name('job_category');
T...
I have a table called EventNotifications and I'm returning all notifications associated to a users current team. I want to restrict the results coming back to only EventNotifications that don't have a relational entry in EventNotificationDismissal....
Any ideas how I can get VUE to return the price I'm calculating instead of Promise
Here is the code:
price: async function () {
let priceForDays = 0;
let finalPrice = 0;
let prices = await axios.get('/api/prices/get/' + this.booking.luggage...
How to get job ID after dispatching? Right now I do it like this:
public function store(UploadFeedRequest $request)
{
UploadFeedJob::dispatch($request->validated());
$jobId = DB::table('jobs')->latest()->get()->first()->id;...
I thought I'd follow the docs to get Laravel up and running with Sail.
At the point in the docs where it says:
curl -s https://laravel.build/example-app | bash
I received the message in the terminal "Docker is not running"
This is my first...
I'm trying to create a new folder inside a public disk but I'm having issues. This is what I have so far
while (Storage::disk('report_upload')->exists($name . '.xlsx')) {
$name .= $counter;
$counter++;
Storage...
namespace App;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class UserInformation extends Model {
/**
* The table associated with the model.
*
* @var string
*/
protected $table = "user_information&qu...
Previously I apologized with the title because I didn't know what the name of the problem was.
I did a loop on the image in my post, initially it was safe but there was a problem when I made the same title as the previous post, the image that appeare...
Why we can get access the route protected by auth:sanctum with User that has no access tokens?
Is this made for tests simplicity?
class PingTest extends TestCase
{
use RefreshDatabase;
/** @test */
public function guest_cannot_ping()...
My Laravel application works fine in on my local machine and on my staging server. But when I deployed to my production server the login form is not working. Every time I try to login to the admin panel it shows my
419
Sorry, your session has expi...
I have a device which will be sending information when a certain event occurs. The application is expected to work globally and so the device will send the time in its local timezone. For this field should I go for dateTime, dateTimeTz or Timestamp?...
Laravel JetStream looks like a huge timesaver, but with Inertia.js it will only provide a Vue front-end, however I'm wanting a React front-end. I'm wondering if anyone has managed to do this, and if so would be willing to contribute their code to the...
I want to call to a method in my parent component within my child component.
so I used an event for that. but I can emit the event using,
this.$emit('event')
it shows an error in the console saying,
TypeError: Cannot read property '$emit' of undefine...
I have three tables: Products, Categories and a pivot one CategoryProduct.
I have an attribute updated_by and I want this to be automatically set to Auth::id() upon all create/update requests.
So far I am able to save data by using the sync() method...
in_array(): Argument #2 must be of type array, string given
Sometimes i dont have an array $item['restricted_countries']), but how to return empty array, instead string?
if ( in_array($geoip_code, $item['restricted_countries']) ) {
return $item...
Hi everyone, How can I prevent a laravel error from appearing when someone tries to go to the / posts address that belongs to the post rout and has the post method? The point is that if someone goes to that address without filling out a form, it sho...
Hi,
I'm a newbie with laravel and I'm trying to learn how to use components but i'm facing an issue with a "Undefined variable" when I use anonymous components inside a other one.
My indexController return me a welcome view and inside this...
hey, what happens to the code below when I press the button, the presence of the button does not send data, and even no error message is generated
<form action="{{route('simpan-data.absensi-siswa')}}" method="post">...
Hello guys, I don't know why request() is not working when I am trying to submit an email form. It is returning null.
``
class MailController extends Controller
{
public function mailview(){
return view('mail');
}
public function mailstore(){
$em...
Hello, Friends I Want To Generate a Custom Image From the First Letter of the Username.
I Search For it And Get The Following Code But It Can't Work For Me.
use Intervention\Image\Facades\Image;
$img = Image::make('/storage/media/user_...