Danieloplata

Danieloplata

Member Since 1 Year Ago

Experience Points 20,620
Experience Level 5

4,380 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 189
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    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.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

11 Jun
1 week ago

Danieloplata left a reply on Unexpected AuthenticationException

Thanks, feeling pretty dumb now :)

Danieloplata started a new conversation Unexpected AuthenticationException

Hi guys,

I recently upgraded a basic CRUD project from 5.7 to 5.8 and worked through fixing a few tests that now failed. I've sorted out all the important ones, but I have an annoying one bugging me.

/** @test */
public function guests_cannot_manage_projects()
{
    $this->withoutExceptionHandling();

    $project = factory('App\Project')->create();

    $this->get('/projects')
        ->assertRedirect('login');
        
    ...
        
}

This test returns:

Illuminate\Auth\AuthenticationException : Unauthenticated.

Manually testing the route gives me the redirect to login as expected.

I figured I could change my assertions here to just check for the exception but that didn't work either, and I would prefer to either check for the redirect or both, rather than just the exception.

07 Jun
1 week ago

Danieloplata left a reply on Class 'Illuminate\Notifications\NexmoChannelServiceProvider' Not Found

I'm not an expert enough to know if this is specifically what fixed my issue, but deleting bootstrap/cache/* appeared to work

Danieloplata left a reply on Class 'Illuminate\Notifications\NexmoChannelServiceProvider' Not Found

According to the 5.8 upgrade notes, they have been extracted to first party packages. Unless Laravel core requires these packages to run, I do not require them.

I can fix the issue by running:

composer require laravel/nexmo-notification-channel
composer require laravel/slack-notification-channel

But how can I avoid needing to require them?

Danieloplata started a new conversation Class 'Illuminate\Notifications\NexmoChannelServiceProvider' Not Found

Ran composer update and now getting errors due to some of the packages it removed. The current error showing is Class 'Illuminate\Notifications\NexmoChannelServiceProvider' not found which was one of the packages removed by the update from (v5.7.28 => v5.8.21)

In Config\App.php, I can see Illuminate\Notifications\NotificationServiceProvider::class is registered under providers.

Anyone got any ideas how to fix?

30 May
2 weeks ago

Danieloplata left a reply on Pivot Table Always Returning Null

Seems the issue was with the naming convention as I expected - renaming the model to the singular form fixed it all. I thought I was going the right way about overriding the defaults but seems not..

Danieloplata left a reply on Pivot Table Always Returning Null

Tried it both ways with no luck

Alt text

May or may not be relevant - When changing the code to add the key names, I noticed that each time my database had been completely reset. It is there and retrievable when I run this in tinker though.

Danieloplata started a new conversation Pivot Table Always Returning Null

Here is my relationship..

Model - Group:

public function refreshments()
{
    return $this->belongsToMany(Refreshments::class, 'group_refreshments')
        ->withPivot('quantity');
}

Migration - create_refreshments_table:

Schema::create('refreshments', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->string('name')->unique();
    $table->decimal('price');
    $table->timestamps();
});

Schema::create('group_refreshments', function (Blueprint $table) {
    $table->unsignedInteger('group_id');
    $table->unsignedInteger('refreshments_id');
    $table->tinyInteger('quantity');
    $table->primary(['group_id', 'refreshments_id']);
});

My tinker log:

php artisan tinker
Psy Shell v0.9.9 (PHP 7.1.20 — cli) by Justin Hileman
>>> $group = factory('App\Group')->create()
=> App\Group {#2969
     project_id: 2,
     start_time: "2019-05-30 10:36:36",
     end_time: "2019-05-30 10:36:36",
     participants: 13,
     participant_sandwiches: 1,
     clients: 16,
     client_sandwiches: 1,
     light_buffet: 0,
     hot_buffet: 0,
     cold_buffet: 1,
     takeaways: 1,
     hot_drinks_and_biscuits: 1,
     drinks: 1,
     food_timing: "ASAP",
     created_at: "2019-05-30 10:36:36",
     updated_at: "2019-05-30 10:36:36",
     id: 2,
   }
>>> $group->refreshments()->attach(1, ['quantity' => 5])
=> null
>>> $group->refreshments()->attach(14, ['quantity' => 10])
=> null
>>> $group->refreshments
=> Illuminate\Database\Eloquent\Collection {#2961
     all: [],
   }
>>> $group->refreshments()
=> Illuminate\Database\Eloquent\Relations\BelongsToMany {#2974
     +withTimestamps: false,
   }

The refreshments are successfully added and appear in my SQL client.

I suspect I may have an issue with the naming conventions (specifically Refreshments being plural?) which is why I tried to manually define the table name for the pivot.

05 May
1 month ago

Danieloplata left a reply on How To Sort An Array Of Objects In Laravel?

@kane Thanks, after reading the page I was able to achieve my goal quite simply.

$unsortedData = collect([
    ...
]);

$sortedData = $unsortedData->sortByDesc('score');

Danieloplata started a new conversation How To Sort An Array Of Objects In Laravel?

I'm trying to sort an array of objects, by a property on the objects.

The data structure looks like this:

Array
(
    [0] => stdClass Object
        (
            [ID] => 1
            [name] => 'Test1'
            [score] => 800
        )

    [1] => stdClass Object
        (
            [ID] => 2
            [name] => 'Test2'
            [score] => 200
        )

    [2] => stdClass Object
        (
            [ID] => 3
            [name] => 'Test3'
            [score] => 500
        )

A quick google suggests I should be able to use

public function sortByScore ($a, $b)
{
    return strcmp($a->score, $b->score);
}

$mySortedData = usort($myData, array($this, 'sortByScore'));

This appears to cause my data to be completely replaced with the value true, and subsequently causes my foreach to fail.

Anyone got any idea how I can achieve this?

12 Mar
3 months ago

Danieloplata left a reply on ReflectionException: Class Env Does Not Exist

Worked again now after trying a load of different commands - last 2 used were

composer dump-autoload -o
php artisan config:clear

No idea if these 2 always work or if they worked in combination with something else I tried..

Danieloplata started a new conversation ReflectionException: Class Env Does Not Exist

Hi guys,

Having an annoying issue where I can't run my PHPunit tests, nearly all tests return the following error:

ReflectionException: Class env does not exist

From googling, most results suggest adding <env name="TELESCOPE_ENABLED" value="false"/> to the phpunit.xml file. However, I have had this in my config from the start.

The error normally seems to occur after running cache clearing commands such as

php artisan config:cache
php artisan cache:clear

I've had the error a number of times now and it appears to resolve itself after a while, but it would be nice to be able to run my tests :)

07 Mar
3 months ago

Danieloplata left a reply on Observer Not Firing

@COBS - Still same error unfortunately

Ran commands:

php artisan clear-compiled php artisan cache:clear composer dump-autoload

Danieloplata left a reply on Observer Not Firing

@COBS - ProjectObserver.php

use App\Project;
use App\Activity;
...
public function created(Project $project)
{
    Activity::create([
        'project_id' => $project->id,
        'description' => 'created'
    ]);
}

Panel relationship:

public function project()
{
    return $this->belongsTo(Project::class);
}

Danieloplata started a new conversation Observer Not Firing

Hi

I've set up 2 observers for my project, one is firing normally and the other doesn't appear to be firing at all..

AppServiceProvider.php

use App\Project;
use App\Panel;
...

public function boot()
{
    Project::observe(ProjectObserver::class);
    Panel::observe(PanelObserver::class);
}

PanelObserver.php

use App\Panel;
use App\Activity;
...

public function created(Panel $panel)
{
    Activity::create([
        'project_id' => $panel->project->id, // $panel->project->id is returning correct #
        'description' => 'panel_created'
    ]);
}

PHPUnit test:

public function setUp() 
{
    parent::setup();
    $this->be($user = factory('App\User')->create());
    $this->project = factory('App\Project')->create();
    $this->panel = factory('App\Panel')->create(['project_id' => $this->project->id]);
}

/** @test */
function creating_a_panel_generates_activity()
{
    $this->assertCount(2, $this->panel->project->activity);
    $this->assertEquals('panel_created', $this->panel->project->activity->last()->description);
}

Error:

Failed asserting that actual size 1 matches expected size 2.

We should have 2 records in the Activity, from the creation of the Project and the creation of the Panel. The Panel creation isn't being recorded, while the Project is.

22 Feb
3 months ago

Danieloplata left a reply on Best Way To Export Data In Xml And Csv Format

I know this isn't a pretty solution but you could use the Maatwebsite to export a CSV, save a copy then convert it to XML

https://stackoverflow.com/a/4853122/4046347

Or you would write a script of your own to parse the CSV into an XML file.

20 Feb
3 months ago

Danieloplata started a new conversation Unable To Dump On Middleware

Hi, I've created a new bit of middleware for an App I've been working on. I'm trying to dump the request variable but the dd($request); seems to be ignored.

I am using Telescope, and the dump doesn't appear there, however the request does show the correct middleware assigned.

Any ideas what might be causing this/what I'm doing wrong?

08 Jan
5 months ago

Danieloplata left a reply on Suggest Me A License For This CMS I Built Over Last 2 Years That I Plan To Open Source

@d9705996 If it was my project, I would release it with a GNU-GPL v3 license.

Remember that simply having a license doesn't prevent people from breaking your license terms, you would need to find and prove misuse and potentially incur legal costs to actually act on them.

26 Oct
7 months ago

Danieloplata left a reply on 405 Method Not Allowed

@tykus Thanks, I found the error in the path, I was appending the project_id to the route, rather than passing it though the route.

// Returns "projects?/1
public function path()
{
    return route('destroyProject') . $this->id;
}

Fixed by changing to:

// Returns "projects/1"
public function path()
{
    return route('destroyProject', $this->id);
}

Danieloplata left a reply on 405 Method Not Allowed

@munazzil After removing the middleware, a status of 405 was still returned

Danieloplata left a reply on 405 Method Not Allowed

@RamjithAp I see the route in my route:list

DELETE | projects/{project} | destroyProject | App\Http\Controllers\[email protected] | web,auth

I have ran route:clear to clear the cache but this didn't resolve the issue

Danieloplata started a new conversation 405 Method Not Allowed

Hi, I'm trying to get a test working for my destroy method and it's failing with a 405 response.

My test:

...

public function setUp() 
{
    parent::setup();
    $this->be($user = factory('App\User')->create());
    $this->project = factory('App\Project')->create();
}

...

/** @test */
public function an_authenticated_user_can_delete_a_project()
{
    $response = $this->delete($this->project->path());
    $response->assertStatus(200);
    $response->assertRedirect(route('projectsOverview'));
}

My route:

Route::delete('/{project}', '[email protected]')->name('destroyProject');

My destroy method:

public function destroy(Project $project) 
{
    $project->delete();

    return redirect()
        ->route('projectsOverview')
        ->with('message', 'Project deleted');
}
24 Oct
7 months ago

Danieloplata left a reply on Syntax Error, Unexpected ')'

@vladv Thanks Vladv, I forgot we added an "addReply" to the Thread model and called it in the ReplyController - I found the obvious error in the Controller :)

Danieloplata started a new conversation Syntax Error, Unexpected ')'

Hi guys, following the build forum with TDD videos and I'm getting the following error when running the ParticipateInForumTest

1) Tests\Feature\ParticipateInForumTest::an_authenticated_user_can_reply_to_threads
Symfony\Component\Debug\Exception\FatalThrowableError: syntax error, unexpected ')'
C:\Laragon\www\forum\tests\Feature\ParticipateInForumTest.php:26

I've added which line is line 26 in my code below - it doesn't look incorrect to me, so I'm assuming we're getting this unexpected ) from somewhere else.

class ParticipateInForumTest extends TestCase
{
    use RefreshDatabase;

    /** @test */
    public function an_authenticated_user_can_reply_to_threads()
    {
        // Create a user and sign them in
        $this->be($user = factory('App\User')->create());

        // Create a thread
        $thread = factory('App\Thread')->create();

        // Create a reply
        $reply = factory('App\Reply')->create();

        // Post the reply (below is line 26)
        $this->post('/threads/' . $thread->id . '/replies', $reply->toArray());
        
        // Assert that it worked
        $this->get($thread->path())
            ->assertSee($reply->body);
    }
}
23 Oct
7 months ago

Danieloplata left a reply on ParseError: Syntax Error, Unexpected 'public' (T_PUBLIC), Expecting ',' Or ';'

@goatshark Thanks Goatshark, I thought the error must exist in the test page.

I've found the error in my Thread::class. Was missing a semi colon where I had deviated slightly from the lesson (I feel safer using$fillablerather than$guarded = []`)

protected $fillable = [
    'user_id',
    'title',
    'body'
]

Danieloplata started a new conversation ParseError: Syntax Error, Unexpected 'public' (T_PUBLIC), Expecting ',' Or ';'

Currently following this lesson (I'm using Laravel 5.7)

https://laracasts.com/series/lets-build-a-forum-with-laravel/episodes/4?autoplay=true

I'm getting the following error in my test:

1) Tests\Unit\ThreadTest::a_thread_is_owned_by_a_user
ParseError: syntax error, unexpected 'public' (T_PUBLIC), expecting ',' or ';'

Here is the code from my test:

namespace Tests\Unit;

use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ThreadTest extends TestCase
{

    use RefreshDatabase;

    protected $thread;

    public function setUp()
    {
        parent::setUp();
        $this->thread = factory('App\Thread')->create();
    }

    /** @test */
    public function a_thread_is_owned_by_a_user()
    {
        $this->assertInstanceOf('App\User', $this->thread->user);
    }

    /** @test */
    public function a_thread_has_replies()
    {
        $this->assertInstanceOf('Illuminate\Database\Eloquent\Collection', $this->thread->replies);
    }

    /** @test */
    public function a_thread_can_add_a_reply()
    {
        $this->thread->addReply([
            'body' => 'Foobar',
            'user_id' => 1
        ]);

        $this->assertCount(1, $this->thread->replies);
    }

}
12 Oct
8 months ago

Danieloplata left a reply on HTTP Response Pages

Thanks, looks like it wasn't the proper raw file - not familiar with SVG files, would never have realised :P

Danieloplata left a reply on HTTP Response Pages

Thanks @tykus , I have downloaded the files and added to my project. However, they don't seem to be loading. When I try to access the SVG file directly, I get the following error.

This page contains the following errors:
error on line 43 at column 89: Specification mandates value for attribute data-pjax-transient
Below is a rendering of the page up to the first error.
laravel/404.svg at master · laravel/laravel

Danieloplata started a new conversation HTTP Response Pages

Hi guys, with 5.7 came a bunch of new fancy looking HTTP Response Pages, but the SVG files didn't get included with my Laravel install.

Is there any way to download them/source them?

25 Sep
8 months ago

Danieloplata started a new conversation Middleware Question

Hi, I've got an app that I'm making while learning and want to ask how to handle this situation. Apologies if this isn't a middleware thing.

I have a route in my app:

Route::get('/start/{panelid}/{respondentid}', '[email protected]')->name('redirectStart');

This route will basically create a record in my database and then redirect you to a relevant external site.

There are some criteria, where I may wish to prevent the user from being redirected. For example..

// Get users country via API

if(in_array($countrycode, $allowedCountries)) {
    // continue the redirect process
}

I intend to add more checks, such as preventing someone with the same ip/useragent being redirected to the same place twice, and logging it as a duplicate attempt if necessary.

When I've done this before in Vanilla/Procedural PHP, I've just stuck a bunch of if statements before the code I want to run, so I'm a little lost on how I should structure this. If middleware is the way to handle this, should each "check" be it's own middleware?

29 Aug
9 months ago

Danieloplata left a reply on Query To Return Totals By Job Number

Hi @finchy70,

I'm not sure the way you've set up the database works very well - and it looks like you are making it complicated for yourself.

Would it not be a better idea to have a separate record for each job?

mon_job_number1_hours
mon_job_number2_hours
mon_job_number3_hours

Why not have 1 column for job_number and then another for hours

Doing it this way would allow you to make a query like:


// Get total hours per job in Period 1

SELECT SUM(hours)
FROM your_database
WHERE period = 1
GROUP BY job_number
03 Aug
10 months ago

Danieloplata left a reply on Not Sure Which Relationship To Use

@tykus Thanks, I was sure I got it wrong. :) I had some idea in my mind that something could only "belong" to one thing at a time. In this case, a Panel already belongs to a Project.

Danieloplata started a new conversation Not Sure Which Relationship To Use

Hi, I'm trying to link up two of my models in my project. Here's a simplified look at how it's working:

Project.php

public function panels()
{
    return $this->hasMany(Panel::class);
}

Panel.php

public function project()
{
    return $this->belongsTo(Project::class);
}

public function provider()
{
    return $this->hasOne(Provider::class);
}

So every panel needs a provider, the same provider could be used by many panels.

The way I've got it set up, is my Panels table has a provider_id, but using the above code, eloquent tries to look in the Providers table for a panel_id.

So, my project->panel relationship works fine, but my panel->provider relationship seems backwards, I think I'm using the wrong type of relationship.

30 Jul
10 months ago

Danieloplata left a reply on Redirecting To The Stored Record

@tykus @cmdobueno Thanks guys, this solved it for me. I knew i was doing something wrong - I'm trying some things a little ahead of my laracast classes (and my first time using OOP) :P

Danieloplata left a reply on Redirecting To The Stored Record

@tykus Hi Tykus, I included that just before your reply

Danieloplata left a reply on Redirecting To The Stored Record

@cmdobueno Sorry, you are correct in your guess. The function isn't returning the project. Here is the referenced function:

public function createProject(Project $project)
{
    $this->projects()->save($project);
}

Danieloplata started a new conversation Redirecting To The Stored Record

Hi, In my project I would like to create a project, then redirect to it. My code to create a project works fine:

auth()->user()->createProject(
    new Project(request()->all())
);

session()->flash('message', 'Project created');

return redirect('/projects/');

To attempt to redirect to the project after creating it, I amended the code as follows:

$project = auth()->user()->createProject(
    new Project(request()->all())
);

session()->flash('message', 'Project created');

return redirect('/projects/'.$project->id);

// return route('showProject', $project->id);

Unfortunately the redirect line errors with: Trying to get property of non-object

Am I using this incorrectly?

29 Jul
10 months ago

Danieloplata left a reply on I Want To Learn Laravel But Lots Of Videos Seem Outdated

Hi @CodingRanger

I've been learning Laravel for a couple of weeks/months now as my first foray into OOP PHP and my first time using a framework. I'd say that the 5.4 getting started guide is all still relevant and very worth watching.

The only major difference that I've come across between 5.4 and 5.6 as far as that video series is concerned is a file-structure change on the "Sending email" lesson, where Jeffrey references some register methods, which now exist in a different file. Naturally I got stuck there for a little while, but after asking on the forums, I was quickly given help by the awesome @Cronix and was happily continuing the series minutes later.

21 Jul
10 months ago

Danieloplata left a reply on Email User After Registration

@Cronix Perfect, thank you!

Danieloplata started a new conversation Email User After Registration

Hi guys, so I just watched the video from 5.4 from scratch where Jeffrey emails a user after creating their account and as I'm watching a series that is a little out of date.. The code has changed a bit since the video.

The "RegistrationController" is now "RegisterController"

protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);
        \Mail::to($user)->send(new Welcome($user));
    }

No email is being sent using the above.

I've tested that the emails are working. The command below works perfectly in tinker:

Mail::to($user = App\User::first())->send(new App\Mail\Welcome($user));

My concern here is that I'm not sure how to access the newly created User object with this new code layout.

12 Jul
11 months ago

Danieloplata left a reply on Sending Multiple Emails To Contacts From Database With CC?

Two potential options:

1 - Use a valid address to get around the RFC check 2 - Disable the code that throws an exception if the RFC check fails

File can be found in:

vendor\swiftmailer\swiftmailer\lib\classes\Swift\Mime\Headers\MailboxHeader.php

private function assertValidAddress($address)
    {
        if (!$this->emailValidator->isValid($address, new RFCValidation())) {
            throw new Swift_RfcComplianceException(
                'Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'
            );
        }
    }
14 May
1 year ago

Danieloplata left a reply on Single Route - Multiple Actions

Thanks Cronix. I had understood to create the code in such a way violated MVC rules.

Sorry Snapey, my understanding of classes is very weak. I came from 100% procedural style with no classes or functions. I have difficulties understanding the flow of information.

In vanilla PHP I would basically make a couple of SQL queries, and a header redirect and wrap it in an if(isset.. on the GET variables.

Danieloplata left a reply on Single Route - Multiple Actions

Obviously this is something quite simple in vanilla PHP that is quite difficult with OOP/Frameworks. I would just make multiple SQL queries on the same page.

Do you have any suggestions to how I can achieve both actions? (1. storing a respondent and 2. SQL lookup for a link)

Danieloplata left a reply on Single Route - Multiple Actions

Hi Cronix,

I am assuming a post route can still access the variables set in the route?

(don't be confused by my route example, the create method simply gets the view to create a project. I have a seperate 'store' method to actually save it.)

My project serves as a middleman, so a respondent already exists on someone else's database. I'm passing the ID via the URL to record it.

Let's say I wanted to create a project and a respondent via the same link, is it as simple as having 2 routes which reference the same URL? e.g.

Route::post('/start/{projectID}/{respondentID}', '[email protected]')->name('storeProject');
Route::post('/start/{projectID}/{respondentID}', '[email protected]')->name('storeRespondent');

Danieloplata started a new conversation Single Route - Multiple Actions

Hi, sorry if this is quite a basic/dumb question. So far from the Laravel from Scratch tutorials, I have created routes and models with a single function - like a

Route::get('/projects/create', '[email protected]')->name('createProject');

Which then runs the create function of my ProjectController

My question is: How do I perform multiple actions based on a single route?

For example:

If I created the following route

Route::get('/start/{panelid}/{respondentid}'

How would I go about both

1 - Creating a Respondent in the respondent table 2 - Looking up the {PanelID} in the database (in this case a URL stored in the database) 3 - Redirecting to that link?

18 Apr
1 year ago

Danieloplata left a reply on How To Add Watermark On PDF File

Hi Rinkesh, take a look at this library on Packagist:

https://packagist.org/packages/binarystash/pdf-watermarker

Maybe this suits your needs

16 Apr
1 year ago

Danieloplata left a reply on Conflict Between Views

@Rin4ik @tykus Thanks guys, Rin4ik's solution to use composer dump-autoload solved the 404 after changing my routes to the correct order.

Danieloplata left a reply on Conflict Between Views

Hi guys,

I've changed the order to:

// Main panel views
Route::get('/panel', '[email protected]')->name('panelOverview');
Route::get('/panel/create', '[email protected]')->name('createPanel');
Route::post('/panel', '[email protected]')->name('storePanel');
Route::get('/panel/{panel}', '[email protected]')->name('showPanel');

And I still get the 404 on createPanel

Danieloplata started a new conversation Conflict Between Views

Hi, I'm following the Laravel from scratch guide and Jeffrey comments out the route to show individual posts. I copied this, and my "create" method works fine. However, if I have both "createPanel" and "showPanel" routes active - the create route returns a 404. I believe this is because my route is looking for a record with the ID "create", conflicting with showPanel.

// Panel Displays

Route::get('/panel', '[email protected]')->name('panelOverview');
//Route::get('/panel/{panel}', 'Pa[email protected]')->name('showPanel');

// Panel Creation
Route::get('/panel/create', '[email protected]')->name('createPanel');
Route::post('/panel', '[email protected]')->name('storePanel');

Everything works seperately.