Member Since 1 Year Ago
820 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.
Replied to Target Class...does Not Exist Error Only On Production, Not Dev
This was precisely the problem, thank you.
Started a new Conversation Target Class...does Not Exist Error Only On Production, Not Dev
There are so many google finds on this but none seems to fix my situation.
Its Laravel 7.25 on PHP7.3.
I've got:
Route::apiResource('enquiries','api\WebsiteEnquiryController');
in my routes file. The referenced controller exists in the Http\Controllers\Api folder and is namespaced there. No namespace in the routes file.
In short, this works perfectly running on local dev with php artisan serve.
I zipped up and deployed to DO using instructions here (https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-laravel-with-lemp-on-ubuntu-18-04) adapted since I am not installing laravel fresh but deploying from local machine. Configures the site etc.
The mysite/login page shows up but mysite/api/enquries blows up with this error.
I feel I missed a step but not sure what it is or how to find. Have tried adding use statements in the routes file, using WebsiteEnquiryController::class but none worked.
Would appreciate any help.
Awarded Best Reply on Handling Default Date Of 0000-00-00 When Modernizing An Old PHP App Into Laravel
ok, setting strict to false in database.php solved it!
Replied to Handling Default Date Of 0000-00-00 When Modernizing An Old PHP App Into Laravel
ok, setting strict to false in database.php solved it!
Replied to Handling Default Date Of 0000-00-00 When Modernizing An Old PHP App Into Laravel
just looked at the code again and its actually not using timestamp:
$table->date('datefrom')->nullable()->default('0000-00-00');
So why is this failing, also when datetime('datefrom') is used?
Illuminate\Database\QueryException
SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'datefrom'...
Replied to Handling Default Date Of 0000-00-00 When Modernizing An Old PHP App Into Laravel
Thanks a great deal. (Wonder why digitaldreams/laracrud generates timestamp by default for a pure date field.)
Started a new Conversation Handling Default Date Of 0000-00-00 When Modernizing An Old PHP App Into Laravel
So I have some pretty-nasty old PHP code I'm trying to port to Laravel. Its got a lot of direct mysql queries and quite a lot expect default dates of '0000-00-00' in certain date fields.
Now I'm using mysql 5.6 in dev and even in production, I am able to set the flag to allow this type of date.
My migration file (created with a tool from exiisting database) is however throwing an error about this date, even though the underlying database doesn't mind it.
Is there a flag I can use to Laravel accept it and run migrations as expected?
Replied to Where Is The Multiple Primary Key Defined In This
Thanks @martinbean. I'm trying to convert an old non-structured php app to laravel. I thought to first have a laravel version running with the existing database and then gradually change all these horrible things in the back-end over time. That way users can start enjoying benefits of the framework faster.
Hope this is not a bad approach?
Replied to Where Is The Multiple Primary Key Defined In This
@ftiersch: Thanks, so to test I'm changing the $table->primary... to $table->index(..)->unique();
When I re-run my migration, its telling me the table already exists.
But it doesn't exist from looking with phpadmin.
How can I resolve this pls?
Started a new Conversation Where Is The Multiple Primary Key Defined In This
One of my migration files has:
public function up()
{
Schema::connection('mysql2')->create('customer_proposed', function (Blueprint $table) {
$table->integer('CustomerID', true);
$table->integer('OrgID')->index('OrgID');
$table->string('Name', 100)->nullable();
$table->string('AddressLine1', 50)->nullable();
$table->string('City', 20)->nullable();
$table->integer('State')->nullable()->index('State');
$table->decimal('CreditLimit')->nullable();
$table->smallInteger('PaymentTerms')->nullable();
$table->string('CustomerCode', 20)->nullable();
$table->integer('defaultsm')->nullable()->index('defaultsm');
$table->integer('importid')->nullable()->index('importid');
$table->primary(['CustomerID', 'OrgID']);
});
}
I get a QueryException saying: SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined (SQL: alter table customer_proposed
add primary key customer_proposed_customerid_orgid_primary
(CustomerID
, OrgID
))
I used a tool to generate the migration from an existing database so the source is a valid mysql table. Why then is Eloquent refusing it and what needs to be corrected?
Started a new Conversation Components For Livewire
I have an old PHP5.6 project I need to modernize and have been agonizing over whether to use VueJS or Livewire. It's most essential to have smooth user experience, hence it cannot be pure server-side. I don't really want to go the inertia.js path.
My challenge: I can't shake off the feeling I might go half-way and discover I cannot find a component to use for livewire. For instance, I have need for a double-select and do not have the skills or time to build such basic level components (for Vue, I would be using Buefy or Quasar; would have loved to use Tailwind but Headless UI not ready yet and TailwindUI also lacking in comprehensive ready-to-deploy components.)
I've come across https://github.com/imliam/awesome-livewire which has quite a lot but still do not see anything like a double-select. Some also look a bit experimental.
Is there a more comprehensive source of ready-made livewire components anyone can share?