Sinnbeck

Sinnbeck

Programmer at Aalund

Member Since 4 Years Ago

Odder

Experience Points
451,000
Total
Experience

0 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
151
Lessons
Completed
Best Reply Awards
698
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 50
451,000 XP
May
16
1 month ago
Activity icon

Awarded Best Reply on Laravel Mix

Well that depends. Do you need to support the last 10 versions of all browsers?

If you need to be more specific you can pass multiple keys to that array

mix.options({
    postCss: [
        require('autoprefixer')({
            browsers:[
    "last 1 chrome version",
    "last 1 firefox version",
    "last 1 safari version",
    "last 1 ie version"
  ]
        })
    ]
});
Apr
23
2 months ago
Activity icon

Commented on Private Channels

For anyone getting a 419 error. You need to add the csrf token to the page

https://laravel.com/docs/6.x/broadcasting#configuration

<meta name="csrf-token" content="{{ csrf_token() }}">
Apr
16
2 months ago
Activity icon

Awarded Best Reply on Subscription Business And Personal

Try sending the question to [email protected]

Apr
15
2 months ago
Activity icon

Awarded Best Reply on 'App\Helpers\mysql' Not Found

Setup laravel to use the connection and use the DB:: facade to make the query. You can make a raw query using DB::raw(YOUR SQL QUERY HERE);

https://laravel.com/docs/6.x/database#running-queries

Mar
30
3 months ago
Activity icon

Awarded Best Reply on PHP Excel Dropdown List

Can I suggest you try the mr excel forums? The chances of finding an excel expert over there is alot bigger than here

https://www.mrexcel.com/board/forums/excel-questions.10/

Mar
28
3 months ago
Activity icon

Awarded Best Reply on How Remove Specifc Array Key From Request

Here you go. This should do it.

$arr = [
        "order_quantity" => [
            1643248297 => "1233",
            3434504227 => "202"  
        ],
        "order_price" =>  [
            1643248297 => "180",
            3434504227 => "120"  
        ]
    ];
    $exclude = 1643248297;
    $filtered = collect($arr)->mapWithKeys(function($item, $key) use ($exclude) {
        return [$key => collect($item)->reject(function ($item, $key) use ($exclude) {
            return $key == $exclude;
        })];
    });
Mar
27
3 months ago
Activity icon

Awarded Best Reply on Image Problem

Ok it seems you can add an url and in that you can add some unique identifier.

Let's say I try to create a new post. You then generate a key (kinda like crsf). You add this to each upload. When the user then saves the post itself you add the key to that as well, and will be able to link it all together.

You can also flip it around and save the post first and then upload images with the id if the new post

Mar
24
3 months ago
Activity icon

Awarded Best Reply on Vue.js Is Showing Error During Loading Of Image Src (404 (Not Found))

Make sure to not return anything breaking until image url is ready

var url = this.smcard;
if (! url) {
    return ''; //or perhaps a placeholder loading image 
}
Activity icon

Replied to How To Make Daily Mail?

Are you sending using their api? If you are just using smtp, you can just send the mail using any example from laravel

Mar
20
3 months ago
Activity icon

Awarded Best Reply on 404 Not Found When Get Response From API

Remove the response parameter

Route::get('payments/confirmation/', '[email protected]')->name('payments.confirm');

And check request instead

public function confirm(Request $request)
    { 
        dd($request->all());
	
}

Parameter binding like you would need an actual parameter (here I added 222 as an example)

http://127.0.0.1:8000/payments/confirmation/222?status=approved&code=000&reason=Transaction

Activity icon

Replied to Send Data And Use In Default Laravel Mailable

Pass it in through the mail constructor

Mail::to($dbUser->email)->send(new WelcomeMail($time, $text, $stuff));

And use it like described here (pass it through the constructor method)

https://laravel.com/docs/7.x/mail#view-data

Activity icon

Replied to 404 Not Found When Get Response From API

Remove the response parameter

Route::get('payments/confirmation/', '[email protected]')->name('payments.confirm');

And check request instead

public function confirm(Request $request)
    { 
        dd($request->all());
	
}

Parameter binding like you would need an actual parameter (here I added 222 as an example)

http://127.0.0.1:8000/payments/confirmation/222?status=approved&code=000&reason=Transaction

Activity icon

Replied to PHP Fatal Error: Interface 'Symfony\Contracts\Translation\LocaleAwareInterface' Not Found In

Never copy the vendor or node_modules folder around. Always install them

Activity icon

Replied to Take Login Web Routes And Convert To Api

Airlock is alot simpler

Also

You can use Airlock instead of passport if your application doesn't need the Client Credential grant to allow machine-to-machine communication or the Authorization Code grant. These types of communication require more advanced authentication techniques that Airlock is not built to handle.

https://divinglaravel.com/authentication-and-laravel-airlock

Mar
19
3 months ago
Activity icon

Awarded Best Reply on Jquery Help

And the question is?

Activity icon

Awarded Best Reply on Purchase Model Not Found

You already imported it. Remove App

use App\Purchase; //imported here 

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Input;

use Auth;
use Carbon\Carbon;

class PurchaseController extends BaseController
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $purchases = Purchase::all(); //remove App here 
        dd($purchases);
    }

If you use the full namespace inside a class you need to use a slash in front of the name \App\Purchase

Mar
18
3 months ago
Activity icon

Replied to Alternative To User::select('*')?

Just chain it

return User::when($request->input('name'), static function ($query, $name) {
    $query->where('name', '=', $name)
})->when($request->input('role'), static function ($query, $role) {
    $query->where('role', '=', $role)
})->get();
Activity icon

Replied to OrWhere Doesn't Seem To Be Working

How isnt it working? Do you get an error? Does it return the wrong thing? Does the raw query work if you run it manually on the database?

Activity icon

Replied to Shuffle Equal Values

So what you are saying is that Apple can never come right after Apple and Banana can never come right after Banana?

Activity icon

Awarded Best Reply on Can We Able To Connect Active Directory Without Using Any Package?

What package? Ldaprecord.com takes like 15 minutes to implent and this kind of thing is real easy using that

Mar
17
3 months ago
Activity icon

Replied to Seed A Seeder

Well it is really well documented, there are tons of packages to extend it. It is even quite easy to make your own.

It is easy to learn. I taught a colleague laravel from scratch, and he never even used php before (he used python before).

I also like that I can get a project up and running in no time. There is scaffolding in place for most things.

Activity icon

Awarded Best Reply on Update Exiting Booking

What would you like to update? Lets say you want to change the statuscolumn to 0

Booking::where('email', '=', \Auth::user()->email)->update(['status' => 0]);
Activity icon

Awarded Best Reply on Laravel On Shared Hosting

My files are in git so I don't worry about that. For storage and database backup I use Spatie backup

https://github.com/spatie/laravel-backup

And most server providers allow you to make automatic backups of the server as well

Activity icon

Replied to Update Exiting Booking

What would you like to update? Lets say you want to change the statuscolumn to 0

Booking::where('email', '=', \Auth::user()->email)->update(['status' => 0]);
Activity icon

Replied to Update Exiting Booking

		Booking::where('email', '=', \Auth::user()->email)->update($arrayOfUpdateData);
Mar
16
3 months ago
Activity icon

Replied to This Page Isn’t Working Laraproject.com Is Currently Unable To Handle This Request. HTTP ERROR 500

What webserver are you running? Nginx or apache?

Check the log in /var/log/nginx/error.log (or apache2)

Activity icon

Replied to Sql Injection

I would suggest you show your code. As you can see it is kinda messy. Might be better to find a better way of using your data

Activity icon

Replied to Seed A Seeder

Happy to help. I work with it every day. Keep it up and you will get these things down soon :)

Activity icon

Awarded Best Reply on Seed A Seeder

You need to add them to your Database seeder class in the run method (replace with your own seeder names)

/**
 * Run the database seeds.
 *
 * @return void
 */
public function run()
{
    $this->call([
        UsersTableSeeder::class,
        PostsTableSeeder::class,
        CommentsTableSeeder::class,
    ]);
}
Activity icon

Replied to PHP Code Base To IOS

Personally I would make all my components in react and use that for everything. But then again, I am a react developer :)

Activity icon

Awarded Best Reply on Advise Creating A Profile User Route

Yes that is fine, but can be simplified a bit as I assume that a user only have one profile

$profile = $request->user()->profile;
Activity icon

Replied to Seed A Seeder

You need to add them to your Database seeder class in the run method (replace with your own seeder names)

/**
 * Run the database seeds.
 *
 * @return void
 */
public function run()
{
    $this->call([
        UsersTableSeeder::class,
        PostsTableSeeder::class,
        CommentsTableSeeder::class,
    ]);
}
Activity icon

Replied to Advise Creating A Profile User Route

Yes that is fine, but can be simplified a bit as I assume that a user only have one profile

$profile = $request->user()->profile;
Activity icon

Replied to Error In My Contact View

You need to show the code that is causing the error

Activity icon

Awarded Best Reply on Eloquent Relationships Question

It makes it possible to load all data for a relationship for each item, and tuck it neatly into a nested "array". Also it can do so in just two queries. Joins can do this in just one, but it won't load models for your data meaning you need to manually work with the data

Activity icon

Replied to Sendmail

I just tested on my own account following the guide in the link.. Mine is danish but the segment is clearly visible

http://i.imgur.com/wBUkWMT.png

Activity icon

Replied to How Can Make Custome Pagination For A List

Please show some code

Activity icon

Awarded Best Reply on How Can I Pass Variable With Section In Main Layout File?

The problem is that you have an extra ' here (after image)

$imageURL = '/images/'.$category->image;
Mar
15
3 months ago
Activity icon

Awarded Best Reply on How To Set Cron Job On Vultr (Ubuntu Lemp)

Try with runuser instead then

runuser -l www-data -c 'crontab -e'
Activity icon

Awarded Best Reply on Update Not Working

You are using eloquent wrong. Get one (model) not many (collection)

$booking=Booking::find($id);
Activity icon

Replied to I Need Help On How To Retrieve Video Info Using PHP-FFMpeg

Not that I know of. But try passing the local path to it instead of an url. I bet that will fix it

Activity icon

Replied to I Need Help On How To Retrieve Video Info Using PHP-FFMpeg

Just curious. Shouldn't that video url hav an extension other than a dot?

http://localhost/storage/promovideo/Aliquam a deserunt rerum ut et voluptatibus nobis. //would assume an extension here

Can you open the video on that exact link?

Also wouldn't you normally check the local path, not an url?

Activity icon

Replied to How Can I Pass Variable With Section In Main Layout File?

The problem is that you have an extra ' here (after image)

$imageURL = '/images/'.$category->image;
Activity icon

Awarded Best Reply on Many-To-Many Polimorph Relationship Table Pivot

No worries. Yes paymentables would be the correct syntax for auto loading. It's just a matter of personal preference

Activity icon

Replied to Many-To-Many Polimorph Relationship Table Pivot

No worries. Yes paymentables would be the correct syntax for auto loading. It's just a matter of personal preference

Activity icon

Replied to Many-To-Many Polimorph Relationship Table Pivot

Oh sorry, but you original post said nothing of polymorphic.

So the input and output should reference payments? I would then go with payablesas table name and reference it by name in each model

I don't know of any way to have foreign constrains to multiple tables on a polymorphic table (you can give it a shot with this syntax, but I don't know it will work)

$table->foreign('payable_id')->references('id')->on('inputs');
$table->foreign('payable_id')->references('id')->on('outputs');
Activity icon

Replied to How Can I Pass Variable With Section In Main Layout File?

Can you show that part of your code? It's kinda hard to guess the error from a single line of code