thoasty

thoasty

Member Since 1 Year Ago

Experience Points 7,890
Experience
Level
Lessons Completed 1
Lessons
Completed
Best Reply Awards 13
Best Answer
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.

19 Dec
1 month ago

thoasty left a reply on Timestamp Conversion Exception With Carbon

Use the function Carbon::createFromTimestamp('1544590366');

18 Dec
1 month ago

thoasty left a reply on Laravel Blade | Hide If DB Data Doesn't Exists

Look at the forelse statement:

https://laravel.com/docs/5.7/blade#loops

@forelse ($users as $user)
    <li>{{ $user->name }}</li>
@empty
    <p>No users</p>
@endforelse
14 Dec
1 month ago

thoasty left a reply on Cannot Add Foreign Key Constraint

Seems to be an issue of export, rather than import. You might want to export the database in another tool that can handle the order.

thoasty left a reply on Getting Empty ID After Running $model->save()

And what does it say for "auto-increment" under the "table info" tab?

thoasty left a reply on Paginate A Database's Complete Results?

@UCCDEV - Maybe you should look at the pagination feature again:

https://laravel.com/docs/5.7/pagination

Using paginate you wont need manual skip and take...

thoasty left a reply on Getting Empty ID After Running $model->save()

@SLOVENIANGOONER - Im not talking about your migration but whats actually on the database. Can you take a screenshot of your structure, using any usual db inspector?

thoasty left a reply on Multidimensional Array From Vue To Laravel

That error might be coming from your validation rules, as you are not validating reading.*, but reading.*.*

thoasty left a reply on Multidimensional Array From Vue To Laravel

Really depends on your implementation but for example you could use (item, index) inside your v-for to get the index of the current item:

v-for="(item, index) in items"

thoasty left a reply on Getting Empty ID After Running $model->save()

Did you look at the database of the faulty entry with a db inspector? What does it say for auto_increment after you inserted an entry? Did you go sure your structure has auto_increment and PRIMARY key on the id?

thoasty left a reply on Multidimensional Array From Vue To Laravel

Because there is only 1 reading_type[] for 3 reading[] So:

thoasty left a reply on Running Laravel Passport Install On Production Server

@zion Could you please stop giving bad advice / spamming?

He already said that he was aware of composer install and that this would run on every deploy in his configuration, which is not needed for passport install.

thoasty left a reply on Multidimensional Array From Vue To Laravel

for($i = 0; $i < $readings; $i++){

should at least be:

for($i = 0; $i < count($readings); $i++){

thoasty left a reply on Paginate A Database's Complete Results?

I know of the "->paginate(num)" extension I can add to my DB::table, like so instead of 'get':

I only load, say, 50 at a time, and hitting the 'next' or 'previous' button will get the next batch of 50 after that

Thats exactly what paginate() (instead of get()) does.

thoasty left a reply on Running Laravel Passport Install On Production Server

So what do you think could be wrong about using a migration?

thoasty left a reply on Many Users Belong To One Team Which Belongs To One Project - Relationship Problems

"To access the users, I have to do $bid->team[0]->user->name etc rather than $bid->team->user->name as each user is attached to its own team object rather than 1 team object having many users related." So whats the point of this? You will need a pivot table between Team and User to have more than 1 User attached to a team. See many to many relations for this: https://laravel.com/docs/5.7/eloquent-relationships#many-to-many

thoasty left a reply on How Best To Insert Data Into A Production Database?

You technically could use a migration.

See also:

Eloquent::unguard();

for allowing mass fill.

thoasty left a reply on Many Users Belong To One Team Which Belongs To One Project - Relationship Problems

What is your database structure for these models?

11 Oct
3 months ago

thoasty left a reply on Chuck Vs Pagination! Memory Usage

These methods have a different usecase. I assume you know how paginate works.

But "chunk" retrieves not only 15 entries, but all entries in "packets" of 15 entries. So your ram only loads 15 entries at the same time. But in the end, it will have loaded all entries of the query.

thoasty left a reply on Fetch Error Message Generated By File Upload Validator

What are your validation rules?

28 Aug
4 months ago

thoasty left a reply on Laravel Update Without Passing ID

As long as you dont use get(), it will only stay a query and not respect model methods / fillable.

Try

Ticket::where('ticket_number', $posted_ticket_number)->get()->update(array_merge($request->all(), ['picker_start_time' => Carbon::now()]));

And then control with the $fillable attribute, which of the model attributes are actually fillable by user input.

25 Jul
5 months ago

thoasty left a reply on Pagionate Not Showing Link

Shouldnt it be

{{ $subscriber->articles->links() }}

?

thoasty left a reply on Strange Pluralisation Behavior For Route::resource

I am assuming you are using Route::resource('lens', ...). Did you try with Route::resource('lenses', ...) ?

thoasty left a reply on Cloned Project From Git Only Works When All Files Are Inside Vendor/laravel/laravel Map

Check your /vendor/composer/autoload_classmap.php.

There you will find all classes that are included for autoloading. Try composer dump-autoload to regerenate the autoloading.

29 Jun
6 months ago

thoasty left a reply on Dynamic Fields Should Not Have Same Value

You seem to have made a couple of different mistakes then. You should check the rest of your code.

thoasty left a reply on Redirect User To A Specific Page If He Acesses A Conference With Id That Dont Exist

What do you mean with "stays available"? In else, $conference is null..

thoasty left a reply on Redirect User To A Specific Page If He Acesses A Conference With Id That Dont Exist

if ($conference = Conference::find($id)) {
 // exists
}
else {
 // does not exist
}

thoasty left a reply on Dynamic Fields Should Not Have Same Value

You might want to

Log::info($request->all())

to see if the validation really is the issue.

thoasty left a reply on How Can I Limit Unsigned Integer Of Blueprint Object To Only Have At Maximum 10 Numbers?

Try:

$table->addColumn('integer', 'something_else', ['unsigned' => true, 'length' => 10])

Cheers

26 Feb
10 months ago

thoasty left a reply on Event Firing Problem (or Just Trying To Place A Cookie On A Page)

Use

return redirect()->with(array $data);
20 Feb
11 months ago

thoasty left a reply on API And Access Permission In Package

Give the user a special flag (like is_admin) and use a middleware on the routes you want to protect.

thoasty left a reply on Does Alias Work Only Work In View Templates?

Use \ViforiaApi (with a preceding )

thoasty left a reply on Select Box With First Option Empty

Use ->toArray() after pluck(), because pluck returns another Collection.

$campaignLists = ['' => 'Select Campaign'] + Campaigns::where('c_status', '1')->pluck('c_campaign_name', 'c_id')->toArray(); 

thoasty left a reply on How To Solve This Trying To Get Property Of Non-object Error

$edd is not a collection but an object. So use $edd instead of $edd[0] in your AdminUpdate.blade.php

15 Feb
11 months ago

thoasty left a reply on How To Avoid Error That Non-static Model Method Should Not Be Called Statically

Use

Item::query()->increment('price', $value);

thoasty left a reply on How To Integrate Fully With Vimeo Api ? Like Create Channels..albums ..upload Videos

I guess you should use the \Vimeo facade, not the \Vimeo\Vimeo class.

02 Nov
1 year ago

thoasty left a reply on Lang:: Issue

'taskTypes.bob' seems to be 'bob'?

Paste your language file and code.

thoasty left a reply on Using Values Of One Table As Column Names For Another

Use { } instead of ( )

$value->{$column->name}
28 Jun
1 year ago

thoasty left a reply on Error When Using Pluck To Replace Fletch

"pluck" is a Collection method, afaik.

try to use $articoli->giochi->get()->pluck('id')

thoasty left a reply on Pluck Id (integer) Cast To String !

It seems to be a known bug and is already fixed:

https://github.com/LaravelCollective/html/pull/368

thoasty left a reply on Background Tasks

You might want to read about Queues and Jobs:

https://laravel.com/docs/5.4/queues

thoasty left a reply on Pluralized Strings Using __()?

What about:

trans_choice(__(":days Day remaining|:days Days remaining", [...]), $count)

?

thoasty left a reply on Pluck Id (integer) Cast To String !

There are no integer indexes in json. What are you trying to achieve with the output?

thoasty left a reply on Set Config Database Name In Model

Use Config::set($key, $value)

/**
         * Set a given configuration value.
         *
         * @param array|string $key
         * @param mixed $value
         * @return void 
         * @static 
         */ 
        public static function set($key, $value = null)
        {
            \Illuminate\Config\Repository::set($key, $value);
        }
16 Jun
1 year ago

thoasty left a reply on Pivot Table Issue

@skoobi np thank you :)

thoasty left a reply on Pivot Table Issue

See the documentation of the belongsToMany method:

/**
     * Define a many-to-many relationship.
     *
     * @param  string  $related
     * @param  string  $table
     * @param  string  $foreignKey
     * @param  string  $relatedKey
     * @param  string  $relation
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function belongsToMany($related, $table = null, $foreignKey = null, $relatedKey = null, $relation = null)

The second argument is the pivot table, the third is the foreign key relating to this model, the third is the key relating the other model.

So:

return $this->belongsToMany(Category::class, 'category_user', 'user_id', 'category_id')

Cheers

thoasty left a reply on How Can I Return Boolean From Sql Result

/**
     * Determine if any rows exist for the current query.
     *
     * @return bool
     */
    public function exists()
07 Jun
1 year ago

thoasty left a reply on How To Make The Auth Before Everything?

Use a route group for your routes that require authentication:

https://laravel.com/docs/5.4/routing#route-groups

25 Apr
1 year ago

thoasty left a reply on Error In Compiling Less Files In Laravel Mix

It actually tells you the error:

Can't resolve './public/limitless/assets/less/_bootstrap.less' in '/var/www/html/laravel54/resources/assets/less'
 @ /var/www/html/laravel54/resources/assets/less/app.less (line 7, column 0)
 near lines:
   
   @import "public/limitless/assets/less/_bootstrap";

It cant find the file "_bootstrap.less" you referenced in "app.less" on line 7