Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Call to undefined method :last()

php artisan tinker ...

Well if u try to use App<class_name>::first();

It really works, for me i mean. But i tried with last App<class_name>::last();
and the same with reverse method and didn't work appearing the error message: 
	Call to undefined method :last()
    
So, the solution is better using:
			AppFornecedor::get()->first();
            AppFornecedor::get()->last();
            AppFornecedor::get()->reverse();
            
Why? Because, using get() the laravel recognizes that you are working with 
collections.

Comment

PREVIOUS NEXT
Code Example
Php :: laravel Why using additive paramerer in Resource collection raised error 
Php :: word limit in php 
Php :: how to select and deselect all items without use name in laravel 
Php :: php read textarea line by line 
Php :: extract date from datetime object in php 
Php :: dump request in ci 
Php :: how to change directory in command processor 
Php :: laravel check if pagination is empty 
Php :: statamic asset tag 
Php :: php input seperated by space 
Php :: how to check if page is opened by bot 
Php :: how to explode results from multi select form submitted 
Php :: old value on edit table laravel 6 
Php :: laravel seed table 
Php :: Custom searchform 
Php :: php kurzschreibweise if 
Php :: how to disable html coding property in php 
Php :: fat-free captcha plugin 
Php :: AAPL_041621C125@3.25SL2.00 
Php :: Do not call the observer when there is a model update in laravel 
Php :: Symfony 5 - Customize Twig error templates 
Php :: how to clear post array on referesh + not refill when return 
Php :: how to write a php program for an electricity bill using if-else conditions 
Php :: Combining AND, OR and NOT 
Php :: event handler with worker laravel 
Php :: Expected response code 250 but got code "530", with message "530 Must issue a STARTTLS command first. " 
Php :: ? in php 
Php :: php pretty json 
Php :: get action name in yii2 
Php :: get all weeks in month php 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =