Cinek

Experience

4,460

8 Best Reply Awards

  • Member Since 3 Months Ago
  • 1 Lesson Completed
  • 0 Favorites

24th November, 2017

Cinek left a reply on N Days Difference In Two Date Fields • 20 hours ago

$days = 200;
        $diff = MyData::whereRaw('DATEDIFF(updated_at,created_at) < ?')
            ->setBindings([$days])
            ->get();

Cinek left a reply on N Days Difference In Two Date Fields • 20 hours ago

$diff = MyData::select(DB::raw('DATEDIFF(delivery_date,created_at) as days'))->paginate(10);

15th November, 2017

Cinek left a reply on How To Check If Url Contains Parameters And Execute A Action • 1 week ago

You have typo in word "activity".

Better solution than access $_GET directly is

 @if( Request::get('activity') && Request::get('country'))

Cinek left a reply on No Users Found • 1 week ago

Try do this

$trashedAndNotTrashed = User::withTrashed()->get();

If this works then it means your records are deleted using soft delete.

14th November, 2017

Cinek left a reply on Redirect User To Previous URL After Login Into System • 1 week ago

@WeeHong You should have your AuthController in "App\Http\Controllers\Auth". This controller uses AuthenticatesAndRegistersUsers trait, which uses RegistersUsers trait. Simply, you can place redirectPath method in AuthController and it should be overriden.

Cinek left a reply on Redirect User To Previous URL After Login Into System • 1 week ago

You can try to override redirectPath method from RedirectsUsers trait in your auth controller like this:

    {
        return URL::previous();
    }```

6th November, 2017

Cinek left a reply on Polymorphic Relations Images / Articles • 2 weeks ago

What does it mean "code dosent work"? Are there any errors? Maybe

$request->get('image')

is empty and u need to add enctype = multipart/form-data to your "form" html tag?

Cinek left a reply on How To Get Id Of That Particular Record On Select That Record From Selectbox In Laravel • 2 weeks ago

U can build selectbox with id as a value: <select name="comic_publisher" id="publishers"> @foreach($group as $team) <option value="{{$team->id}}">{{$team->comic_group_name}}</option> @endforeach </select> and then you can get the selected value in controller $selectedTeam = $request->get('comic_publisher');

12th September, 2017

Cinek left a reply on How To Make A Selected Dropdown Combobox. • 2 months ago

$selectedrole is id of your actual selected element

Cinek left a reply on How To Use Command() In My Controller? • 2 months ago

Why do you want to run scheduler in controller?

11th September, 2017

Cinek left a reply on Model Is Created With Id = 0 • 2 months ago

Try to change

$table->increments('id');

to

$table->increments('id')->unsigned();

Cinek left a reply on Session Database Table Without IP • 2 months ago

I think that you have to extend default session handler and write your own logic to store session in database. You can extend default DatabaseSessionHandler in your own class and override getDefaultPayload function. Then u can register your own session driver like this: AppServiceProvider.php

Session::extend('custom', function($app) use ($connection) {
            $table   = Config::get('session.table');
            $minutes = Config::get('session.lifetime');
            return new CustomSessionStore($connection, $table, $minutes, $app);
        });

and set it in config: session.php

'driver' => 'custom',

8th September, 2017

Cinek left a reply on Laravel Generate Pdf Using Laravel-dompdf • 2 months ago

Second parameter of the loadView method should be an array. Try this:

$pdf = \PDF::loadView('pages.manager.orders.invoice', compact('invoice_order', 
    'invoice_order_details', 'sub_total'));

5th September, 2017

Cinek left a reply on (1/2) ErrorException Undefined Property: Illuminate\Pagination\LengthAwarePaginator::$photos • 2 months ago

Try it:

@foreach($rooms as $room)

@foreach($room->photos as $photo)
  <img src="{{ '/' . $photo->thumbnail_path }}">
@endforeach

@endforeach

Method "paginate" returns paginated collection of rooms. I suppose that photos is a list of photos of each room so you should iterate after all rooms.

30th August, 2017

Cinek left a reply on Laravel-dompdf Thai Language Not Working • 2 months ago

maybe try to download and add custom font to your html like this:

@font-face {
                font-family: arial;
                font-weight: normal;
                src: url("{{base_path()}}/resources/fonts/thai_font.ttf") format("truetype")
            }

29th August, 2017

Cinek left a reply on Getting Data Between Two Dates • 2 months ago

The pluck method returns a collection of object only with "id" property and the "where" function on "date" property shouldn't working because there is no date property. You should to use pluck method after"where" function.

18th August, 2017

Cinek left a reply on Model Is Created With Id = 0 • 3 months ago

Can you show your migration?

9th August, 2017

Cinek left a reply on Translate Raw SQL Into Eloquent • 3 months ago

Try this:

Facility::orderByRaw("substring('product_id' from 1 for 1)")-> > orderBy('name','ASC')->get();

8th August, 2017

4th August, 2017

Cinek left a reply on Authentication • 3 months ago

Change "table" in your config/auth.php from "users" to "my_table".

3rd August, 2017

Cinek left a reply on VerifyCsrfToken.php • 3 months ago

Please read about CSRF protection in laravel https://laravel.com/docs/5.4/csrf

{{ csrf_field() }} ...

31st July, 2017

Cinek left a reply on How To Use That ? • 3 months ago

Cinek left a reply on Problems About Updating A Model Object • 3 months ago

If you do not want to change the column type u can mark column "check_field" as nullable. If you do not specify a value of a "check_field" column while inserting data to database the value will be set to null.

27th July, 2017

Cinek left a reply on How To Use Different Password Column In Default LoginController In Laravel For Login • 3 months ago

You should override getAuthPassword in your User model just like here:

public function getAuthPassword() { return $this->pass; }

and then change the calling method attempt to:

Auth::attempt($credentials)

This should work.

26th July, 2017

Cinek left a reply on How To Use Different Password Column In Default LoginController In Laravel For Login • 3 months ago

Try to change: if (Auth::attempt(['email'=>$email, 'pwd' =>$password])) to: if (Auth::attempt(['email'=>$email, 'password' =>$password]))

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.