240 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
After adding the mail credential just clear the cache/config
using this simple command
php artisan optimize
OR
php artisan config:clear
php artisan cache:clear
Replied to User Relationships Based On Role
@martinbean Yes, I agreed.
But what about Role management
? I think @kevinv can use this type of scenario for multiple users instead of creating different-2 tables.
Started a new Conversation Livewire/sortable Package.
In my project I've used this package and dragging is working but Now the major part is how to save data in the backend. Means while dragging the element one group to another than status_id
would be updated in the tasks
table.
How can I achieve this...?
please check this my code
livewire blade component code
<div>
@include('includes.livewire-message')
<div class="row" wire:sortable-group="updateTaskOrder">
@foreach($taskKanban as $status)
<div class="col-md-4" wire:key="group-{{ $status->id }}" wire:sortable-group.item-group="{{ $status->id }}">
<div class="card rounded-pill bg-gradient">
<div class="card-body">
<span class="fs-5 fw-bold p-2">{{ $status->name }} {{ $status->id }}</span><span
class="badge position-absolute top-50 end-0 translate-middle bg-pink rounded-pill p-2">{{ count($status->tasks) }}</span>
</div>
</div>
@foreach($status->tasks as $task)
<div class="card br-10 m-2" wire:key="task-{{ $task->id }}" wire:sortable-group.item="{{ $task->id }}">
<div class="card-body">
<img class="profile-xl float-sm-end border" src="{{ $task->assignTo->userProfile() }}">
<h5 class="text-black m-0 fs-6 fw-bold">
<a wire:click.prevent="viewTask({{ $task->id }})" href="#" data-bs-toggle="modal"
data-bs-target="#viewTask">{{ $task->assignTo->name }}</a>
</h5>
<p class="text-dark-gray m-0 fst-italic">Department: {{ $task->department->name }}
</p>
<p class="text-gray m-0 w-90">
Task Title: {{ $task->name }}
<a href="#" class="gray"><i class="bi bi-paperclip p-1 gray"></i></a>
</p>
<span
class="text-pink mt-1 float-start">{{ $task->created_at->calendar().' '.$task->created_at->isoFormat('Do Y') }}</span>
<div class="float-end">
@hasrole('admin')
<a wire:click.prevent="editTask({{ $task->id }})" href="#" class="gray"
data-bs-toggle="modal" data-bs-target="#updateTaskModal">
<i class="bi bi-pencil-square"></i>
</a>
<a wire:click.prevent="putTaskOnTrash({{ $task->id }})"
onclick="confirm('Confirm delete?') || event.stopImmediatePropagation()"
href="#" class="gray"><i class="bi bi-trash p-2"></i></a>
@endhasrole
<a href="#" data-bs-toggle="modal" data-bs-target="#comment" class="gray">
<i class="bi bi-chat-right-text"></i>
</a>
</div>
</div>
</div>
@endforeach
</div>
@endforeach
</div>
</div>
livewire component
<?php
namespace App\Http\Livewire\Dashboard;
use App\Models\Task;
use App\Models\Status;
class Kanban extends Component
{
public $taskKanban;
public function updateTaskOrder($orderIds)
{
ray($orderIds);
}
public function render()
{
ray()->clearAll();
$this->taskKanban = Status::with(['tasks' => function($q){
return $q->where('assign_to', auth()->user()->id)->isActive()->latest();
}])->get();
return view('livewire.dashboard.kanban');
}
}
Replied to Generate A Last 7 Days Weekly Report In Mysql
@kundefine @madyson you can use carbon subDays
method in laravel.
$users = YourModel::where( 'created_at', '>', Carbon::now()->subDays(7))
->get();
give it try as well
Awarded Best Reply on Sync() Add Additional Column Value In Pivot Table
Solved
$task->assignTo()->sync([
$this->assign_to => [
'status_id' => 1,
],
]);
Replied to Sync() Add Additional Column Value In Pivot Table
Solved
$task->assignTo()->sync([
$this->assign_to => [
'status_id' => 1,
],
]);
Started a new Conversation Sync() Add Additional Column Value In Pivot Table
In my project I have User,Task,Status
model. and I have pivot table which stores task_id, user_id, status_id
.
Then problem is now if I sync
or store the value status_id
is not stored can anyone tells me how to store 3rd value in pivot table.
// IN Task Model I have relationship like
public function assignTo()
{
return $this->belongsToMany(User::class,'task_user','task_id','user_id');
}
code
$task = auth()->user()->tasks()->create([
'name' => $this->title,
'message' => $this->message,
'department_id' => $this->department_id,
'deadline_id' => $this->deadline_id,
]);
$task->assignTo()->sync([
'user_id' => $this->assign_to,
'status_id' => 1,
'created_at' => now(),
]);
Replied to Retrieve An Input Form The Query String
do you want to get 50 items ? then do this
$todos = $this->user->todos()->take(50)->get(['id', 'title', 'body', 'completed', 'created_by']);
OR
$todos = $this->user->todos()->paginate(50);
return response()->json($todos->toArray());
If you are creating an API user Laravel API https://laravel.com/docs/8.x/eloquent-resources#resource-collections technique
Replied to JQuery Reset Selected Option
@www888 Then why you tried this for ajax...? just use simple jquery...for dom changes..
Replied to BelongsToMany With UpdateOrCreate
@eddieace check this link you will get why every time new database record is created... https://stackoverflow.com/a/42696141/8455396
Replied to Department, User, Task Assign
@nimrod Yes for future reference task would be assigned to multiple users... So I have to create another intermediate table now...?
Replied to JQuery Reset Selected Option
so you want to create 3rd level descendent dropdown level..?
Replied to JQuery Reset Selected Option
@www888 what are trying actually...? however, if you change the selectA then there below children selected attribute will be reset..?
Started a new Conversation Department, User, Task Assign
In my project I stuck with some table relationship. Hope anyone can solve my problem to resolve schema relationship between tables...
Basic steps...
First Admin login
Second He will create a department
Third, add users
with assign department
Now I'm stucking in fourth point:
Fourth, Then after creating user with department He will goes for Creating Task where he create the task.
But my questing if user hasMany Tasks
then how he would be assign the task
?
should I have to create intermediate table assign_task
like that because in tasks
table there is already a user_id
column
tasks table
id
task_name
task_message
slug
department_id
user_id //this would be user id => created by
How can I implement assign to
should I have to add another column for assign_id like that and what would be the relationship..Or either should go for another new intermediate table?
Replied to Bootstrap5 ERROR In ./node_modules/bootstrap/dist/js/bootstrap.esm.js 6:0-41
@sami.chkeir @devingray_ I solved this issue few days ago... sorry to check this late...
https://popper.js.org/ I run this command and my error solved
npm i @popperjs/core
Started a new Conversation Bootstrap5 ERROR In ./node_modules/bootstrap/dist/js/bootstrap.esm.js 6:0-41
ERROR in ./node_modules/bootstrap/dist/js/bootstrap.esm.js 6:0-41
Module not found: Error: Can't resolve '@popperjs/core' in 'C:\laragon\www\tasky\node_modules\bootstrap\dist\js'
webpack compiled with 1 error
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `mix`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Nick\AppData\Roaming\npm-cache\_logs21-01-23T14_13_45_627Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Nick\AppData\Roaming\npm-cache\_logs21-01-23T14_13_45_776Z-debug.log
I installed fresh laravel project with laravel/ui
package. And I installed new bootstrap5
for this project but when I tried to run npm run dev
command this send the error.
can anyone know how to install bootsrap 5 in laravel 8?
Awarded Best Reply on How Do You Pass Data To A Partial?
@vusumzi Like this
In laravel there is no command for viewComposer so you have to manually create viewComposerFile inside
App\Http\View\Composers\YourFileNameComposer
Then paste these code inside your composer file
<?php
namespace App\Http\View\Composers;
use Illuminate\View\View;
class YourFileNameComposer
{
public function __construct()
{
}
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$view->with(
'notifications', auth()->user()->unreadNotifications,
);
$view->with(
'unread',auth()->user()->unreadNotifications->count(),
);
}
}
Then after Register it into AppServiceProvider
like this
View::composer(
['partials._topbar'], 'App\Http\View\Composers\YourFileNameComposer',
);
Replied to How Do You Pass Data To A Partial?
@vusumzi Like this
In laravel there is no command for viewComposer so you have to manually create viewComposerFile inside
App\Http\View\Composers\YourFileNameComposer
Then paste these code inside your composer file
<?php
namespace App\Http\View\Composers;
use Illuminate\View\View;
class YourFileNameComposer
{
public function __construct()
{
}
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$view->with(
'notifications', auth()->user()->unreadNotifications,
);
$view->with(
'unread',auth()->user()->unreadNotifications->count(),
);
}
}
Then after Register it into AppServiceProvider
like this
View::composer(
['partials._topbar'], 'App\Http\View\Composers\YourFileNameComposer',
);
Replied to How Do You Pass Data To A Partial?
@vusumzi you did wrong...
Replied to Am I Writing Laravel The Right Way !
it is easy and useful...instead of writing sql queries... eloquent is too much user friendly to write query..... just read the docs and watch tutorial...there are plenty free video course on laravel...just watch...
Replied to Bootstrap4 Datetimepicker
there are several library for this you can checkout these
these two i mostly used...
Replied to How Do You Pass Data To A Partial?
@vusumzi there is two way you can pass data to your partials:
read on laravel docs...you will get this idea.
Awarded Best Reply on Create:893 Livewire: The Published Livewire Assets Are Out Of Date See: Https://laravel-livewire.com/docs/installation/
Started a new Conversation Create:893 Livewire: The Published Livewire Assets Are Out Of Date See: Https://laravel-livewire.com/docs/installation/
I don't know why a few days ago my project with livewire was working good...But now today suddenly it won't work. It return some error in console.
create:893 Livewire: The published Livewire assets are out of date
See: https://laravel-livewire.com/docs/installation/
Uncaught TypeError: window.livewire.devTools is not a function
at create:902
can anyone tells me what was the exact problem
Started a new Conversation Spatie/laravel-ray 1.0.0 Requires Spatie/ray Dev-master -> Satisfiable By Spatie/ray[dev-master].
In my laravel app I'm trying to install https://spatie.be/docs/ray/v1/getting-started/installation-in-laravel ray
.
But after running the command in terminal it throw me some error.
can anyone tells me how to solve this...?
λ composer require spatie/laravel-ray --dev
Using version ^1.0 for spatie/laravel-ray
./composer.json has been updated
Running composer update spatie/laravel-ray
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- spatie/laravel-ray 1.0.0 requires spatie/ray dev-master -> satisfiable by spatie/ray[dev-master].
- spatie/laravel-ray 1.0.1 requires spatie/ray ^1.0 -> satisfiable by spatie/ray[1.0.0, 1.0.1].
- spatie/ray[dev-master, 1.0.0, ..., 1.0.1] require symfony/console ^4.2|^5.2 -> found symfony/console[v4.2.0-BETA1, ..., 4.4.x-dev, v5.2.0-BETA1, ..., 5.x-dev] but the package is fixed to v5.1.8 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires spatie/laravel-ray ^1.0 -> satisfiable by spatie/laravel-ray[1.0.0, 1.0.1].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Did anyone try to install and runs the command spatie/ray
.
And my Operating system is windows
Replied to Pagination With Search Filter
@usamafiaz Can you show your controller method what query you have executed..?
In your controller if you have query like this
$users = User::search(request('search_input'))->paginate(15);
then appendwithQueryString()
after paginate.
$users = User::search(request('search_input'))->paginate(15)->withQueryString();
Replied to How To Pass Id For Update In Laravel
@mrperfectionist Try this technique
const id = $("#ID").val();
const route= "{{ route('admin.department.update')}}";
const updateUrl= route+id;
$.ajax({
url: updateUrl
});
Or instead of route you can use url: 'your_url'+ id
Started a new Conversation Preg_match(): Delimiter Must Not Be Alphanumeric Or Backslash (View: C:\laragon\www\crm\resources\views\rfq\lists-rfq.blade.php)
In my project I have file upload system with file and image support... In front page I want to perform a query if user has upload an image then image show other wise not show document... So I make a function in model it throw some errro can anyone tell what i did wrong
protected $fillable = [
'imageable_id',
'imageable_type',
'file_name',
'mime_type',
'file_path',
];
public function fileType()
{
$value = preg_match('image/',$this->mime_type);
if ($value) {
return true;
}
}
Replied to File(docx,pdf) And Image(jpeg,png Etc..) Support Validation Laravel
@snapey
should I have to remove image
?
'images.*' => 'mimes:jpg,bmp,png,pdf,docx|max:1024'
like this => it is correct way..?
Started a new Conversation File(docx,pdf) And Image(jpeg,png Etc..) Support Validation Laravel
In my form I have a file upload tag....but I want to both type of file upload support such as user can upload pdf,docx,image aswell. Can anyone tell me what validation I have to make...?
This is my validation
$validatedData = $this->validate([
'product_name' => 'required',
'images.*' => 'image|max:1024',
]);
Replied to How To Add Multiple Foreign Key In Migration File
@aasifkhan is your states/doctors/countries
id does contains unsignedInteger type?....check their id types....
and try to use unsignedInteger
$table->unsignedInteger('state_id', 255)->nullable();
Started a new Conversation Bootstrap Modal Descendent Dropdown Not Working
In my project, For storing data I’m using the bootstrap modal.
But the problem I faced In my modal that is the descendent dropdown is not working.
If I used this wire: ignore
method if I removed this wire: ignore
method then the modal hides.
Can anyone tell me how can I render the dynamic data while using the wire:ignore
method.
This is my LIvewire component methods
<?php
namespace App\Http\Livewire\Poi;
use App\Poi as AppPoi;
use Livewire\Component;
use App\Tbl_productcategory;
use App\Tbl_product_subcategory;
class Poi extends Component
{
public $product_name;
public $user_id;
public $product_category_id;
public $sub_category_id;
public $isActive;
public $subcategories = [];
public function store()
{
$validatedData = $this->validate([
'product_name' => 'required',
'product_category_id' => 'required',
'sub_category_id' => 'required',
]);
$validatedData['user_id'] = auth()->user()->id;
AppPoi::create($validatedData);
session()->flash('message', 'Row data successfully created.');
$this->reset();
}
public function render()
{
try {
if (!empty($this->product_category_id)) {
$this->subcategories = Tbl_product_subcategory::where('procat_id', $this->product_category_id)->get();
}
return view('livewire.poi.poi')->with([
'product_of_interests' => AppPoi::get(),
'categories' => Tbl_productcategory::has('tbl_product_subcategory')->get(),
]);
} catch (\Throwable $th) {
dd('catch exception', $th->getMessage());
}
}
}
This is my blade component
<div wire:ignore>
<!-- Modal -->
<div class="modal fade" id="poiModal" tabindex="-1" aria-labelledby="poiModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="poiModalLabel">Add New</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form wire:submit.prevent="store">
<div class="modal-body">
<div class="form-group">
<label for="product_name">Product Name</label>
<input wire:model="product_name" type="text" class="form-control" id="product_name" placeholder="eg: shoes">
</div>
<div class="form-group">
<label for="product_category_id">Category</label>
<select class="form-control required"
wire:model="product_category_id" name="product_category_id" id="product_category_id">
<option value="0">Select Category</option>
@foreach($categories as $cat)
<option value="{{ $cat->procat_id }}">{{ $cat->category }}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label for="sub_category_id">SubCategory</label>
<select class="form-control required"
wire:model="sub_category_id" name="sub_category_id" id="sub_category_id">
<option value="">select subcategory</option>
@foreach($subcategories as $subcat)
<option value="{{ $subcat->prosubcat_id }}">{{ $subcat->category }}</option>
@endforeach
</select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</form>
</div>
</div>
</div>
</div>
Replied to Call To Undefined Method Illuminate\Database\Eloquent\Relations\MorphMany::attach()
@tisuchi basically I tried the attached for rfqs
and images
oneToMany relationship table. And user_id
is used in rfqs table.
Replied to BelongsToMany Take 1 .
Replied to Call To Undefined Method Illuminate\Database\Eloquent\Relations\MorphMany::attach()
@tray2 Ohh! so attach
used in only manyTomany case...?
Instead of save can I use create
also?
Started a new Conversation Call To Undefined Method Illuminate\Database\Eloquent\Relations\MorphMany::attach()
In my laravel project I'm trying to add mulitple image for RFQ table...can anyone tell me what i did wrong.
My relationship like: rfq hasMany images AND images belongsTo rfqs
This is my livewire method
public function store()
{
$validatedData = $this->validate([
'product_name' => 'required',
'product_category_id' => 'required|not_in:0',
'sub_category_id' => 'required|not_in:0',
'product_quantity' => 'required',
'unit_id' => 'required|not_in:0',
'purchase_price' => 'nullable',
'city' => 'required|',
'isChecked' => 'required|accepted',
'details' => 'required|string|min:1|max:500',
'images.*' => 'image|max:1024',
]) + [
'user_id' => auth()->user()->id,
];
$rfqData = Rfq::create($validatedData);
// if ($this->images)
// {
foreach ($this->images as $photo) {
$path_url = $photo->storePublicly('rfqs', 'public');
$rfqData->images()->attach($photo,[
'file_name' => $photo->getClientOriginalName(),
'file_path' => $path_url,
]);
}
// }
session()->flash('message', 'RFQ submitted successfully.');
$this->reset();
}
@tisuchi okk I tried it letter but I solve this problem using this conditional statements.
$validatedData = $request->validate([
'product_name' => 'required',
'product_category_id' => 'required',
'sub_category_id' => 'required',
'product_quantity' => 'required',
'unit_id' => 'required|not_in:0',
'purchase_price' => 'nullable',
'city' => 'required|',
'isChecked' => 'required|accepted',
'details' => 'nullable',
])+[
'user_id' => auth()->user()->id,
];
if (request('isChecked') === 'on') {
$validatedData['isChecked'] = true;
}
@tisuchi but in migration, I set it to the boolean...
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column 'isChecked' at row 1 (SQL: insert into `rfqs` (`product_name`, `product_category_id`, `sub_category_id`, `product_quantity`, `unit_id`, `city`, `isChecked`, `details`, `user_id`, `updated_at`, `created_at`) values (Watch, 1, 1, 1, 1, Delhi, on, ?, 37, 2020-12-31 11:10:16, 2020-12-31 11:10:16))
Basically this return error for checkbox. In my table isChecked
column is boolean. And I try dd()
it return on
for isChecked
value. Can anyone tells me how return true/false for isChecked?
Controller Method
public function store(Request $request)
{
$validatedData = $request->validate([
'product_name' => 'required',
'product_category_id' => 'required',
'sub_category_id' => 'required',
'product_quantity' => 'required',
'unit_id' => 'required|not_in:0',
'city' => 'required|',
'isChecked' => 'required|accepted',
])+[
'details' => $request->details,
'user_id' => auth()->user()->id,
];
Rfq::create($validatedData);
return redirect()->withMessage('RFQ submitted successfully.');
}
Replied to How To Add Middleware Auth Condition For Submit Form In Livewire Component
@tray2 ok..but I put the login route then how can I redirect back at the same form...?
Because I did try this but it return to me a dashboard page...
Should I have to chage redirectRoute
...?
Started a new Conversation How To Add Middleware Auth Condition For Submit Form In Livewire Component
In my Laravel project render the livewire component for submiting the form.
What I need?
Basically the form is public but I want a auth
condition means if user submit the form without logged in then the login page appear.
Can anyone tells me how to use $this->middleware('auth')
in livewire component becasue it redirect the error.
This is my component
<?php
namespace App\Http\Livewire\Rfq;
use App\Rfq;
use App\City;
use App\currency;
use App\Tbl_units;
use Livewire\Component;
use App\Tbl_productcategory;
use App\Tbl_product_subcategory;
class RfqForm extends Component
{
public $product_name;
public $product_quantity;
public $unit_id;
public $currency_id;
public $purchase_price;
public $city;
public $details;
public $isChecked;
public $product_category_id;
public $subcategories = [];
public $sub_category_id;
public function updated()
{
$this->validate([
'product_name' => 'required',
'product_category_id' => 'required',
'sub_category_id' => 'required',
'product_quantity' => 'required',
'unit_id' => 'required|not_in:0',
'purchase_price' => 'required',
'city' => 'required|',
'isChecked' => 'required|accepted',
]);
}
public function store()
{
$validatedData = $this->validate([
'product_name' => 'required',
'product_category_id' => 'required',
'sub_category_id' => 'required',
'product_quantity' => 'required',
'unit_id' => 'required|not_in:0',
'purchase_price' => 'required',
'city' => 'required|',
'isChecked' => 'required|accepted',
]);
$validatedData['details'] = $this->details;
// Rfq::create($validatedData);
auth()->user()->rfqs()->create($validatedData);
session()->flash('message', 'RFQ submitted successfully.');
$this->reset();
}
public function render()
{
if(!empty($this->product_category_id)) {
$this->subcategories = Tbl_product_subcategory::where('procat_id', $this->product_category_id)->get();
}
return view('livewire.rfq.rfq-form')->with([
'categories' => Tbl_productcategory::has('tbl_product_subcategory')->get(),
]);
}
}
Replied to Tailwind Dropdown Doesn't Work
@neomuckel which javascript are using...? You have to write javascript for dropdown if you're using tailwind... In this case I suggest use alpine js for simple dropdown..it is easy
Awarded Best Reply on The Requested URL /vendor/livewire/livewire.js Was Not Found On This Server.
Now I have solved this issue by changing the asset_url
in the livewire.config
file
php artisan vendor:publish
config
fileasset_url
null
to your filename'asset_url' => 'MY_PROJECT_NAME',
Replied to The Requested URL /vendor/livewire/livewire.js Was Not Found On This Server.
Now I have solved this issue by changing the asset_url
in the livewire.config
file
php artisan vendor:publish
config
fileasset_url
null
to your filename'asset_url' => 'MY_PROJECT_NAME',
Started a new Conversation The Requested URL /vendor/livewire/livewire.js Was Not Found On This Server.
In my project I have laravel livewire I don't know why this error encounter..
in console it returns this error.
create:77 Uncaught ReferenceError: Livewire is not defined
can anyone tells me what I did wrong the problem
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet" type="text/css">
@livewireStyles
</head>
<body>
<main class="py-4">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<livewire:counter />
</div>
</div>
</main>
@livewireScripts
</body>
</html>
Replied to How To Validate Image In Edit Form If There Is No Image Is Selected
no need of two request classes he can also perform with single class aswell
Replied to How To Validate Image In Edit Form If There Is No Image Is Selected
@coder72 you can do something like this
'image' => ($this->getMethod() == 'POST')
? 'required'
: '',
and in your database table image column should be nullable