is anthing wrong?
How does a user create in a class when there is no method for creating a user in an extending class?
Then where defined create method in my case?
Is there a way to write a 3 way ternary operator?
if ($request->hasFile(‘images’)) {
foreach ($request->file(‘images’) as $image) {
$name=$image->getClientOriginalName();
$thumbnail=Image::make($name)->resize(259,194, function($constraint){
$constraint->aspectRatio()->save(public_path(‘/storage/storage/thumbnail2/’.$request->$image->hasName()));
//Image::make($image)
});
$data[‘images’] = $request->$image->hasName();
}
}
HYIP is High Yield Investment Program
Not a virus
Thanks!!
#/0 is not allowed.
So $hitung is 0 when it reaches like 34.
i get solution dude, so must declaration variable $hitung, like this

foreach ($request->file(‘images’) as $image) {
$name=$image->getClientOriginalName();
$thumbnail=Image::make($name)->resize(259,194, function($constraint){
$constraint->aspectRatio()->save(public_path(‘/storage/storage/thumbnail2/’.$request->$image->hasName()));
//Image::make($image)
});
$data[‘images’] = $request->$image->hasName();
}
}
dd ($request)
dd($request->all())
i solved it…..thanks for your help……
What problem
?
?

Handling files is always a task. This tutorial will simplify the process and show you how to upload files with VueJS and Axios through AJAX.
Thanks dude, your information… about another way…
Cast
i think you should register the admin.manage_roles route to the web.php … Route::get(‘admin/manage_roles’,’ YourController@manage_roles’);
my controller is this
Route::group([‘middleware’ => [‘auth’]], function() {
Route::resource(‘admin.manage_roles’,’RoleController’);
Route::resource(‘admin.manage_users’,’UserController’);
});
is anthing wrong?
Route::group([‘middleware’ => [‘auth’]], function() {
Route::resource(‘admin.manage_roles’,’RoleController’);
Route::resource(‘admin.manage_users’,’UserController’);
});
is anthing wrong?
in your controller there is class that deals with manage_roles..?
yes the classes are already the in that section group
Route::group([‘middleware’ => [‘auth’]], function() {
Route::resource(‘admin.manage_roles’,’RoleController’);
Route::resource(‘admin.manage_users’,’UserController’);
});
is anthing wrong?
Just do a php artisan route: list and you will see what you are doing wrong.
Class
CreateUserByCredentialsTask.php
<?php
namespace AppContainersUserTasks;
use AppContainersUserDataRepositoriesUserRepository;
use AppContainersUserModelsUser;
use AppShipExceptionsCreateResourceFailedException;
use AppShipParentsTasksTask;
use Exception;
use IlluminateSupportFacadesHash;
class CreateUserByCredentialsTask extends Task
{
protected $repository;
public function __construct(UserRepository $repository)
{
$this->repository = $repository;
}
public function run(
bool $isClient = true,
string $email,
string $password,
string $name = null,
string $gender = null,
string $birth = null
): User {
try {
$user = $this->repository->create([
‘password’ => Hash::make($password),
’email’ => $email,
‘name’ => $name,
‘gender’ => $gender,
‘birth’ => $birth,
‘is_client’ => $isClient,
]);
} catch (Exception $e) {
throw (new CreateResourceFailedException())->debug($e);
}
return $user;
}
}
——————————————————
Class UserRepository.php
<?php
namespace AppContainersUserDataRepositories;
use AppShipParentsRepositoriesRepository;
class UserRepository extends Repository
{
protected $fieldSearchable = [
‘name’ => ‘like’,
‘id’ => ‘=’,
’email’ => ‘=’,
‘confirmed’ => ‘=’,
‘created_at’ => ‘like’,
];
}
Here is full source code on github:
https://github.com/apiato/apiato/blob/9.0/app/Containers/User/Tasks/CreateUserByCredentialsTask.php
PHP Framework for building scalable API’s on top of Laravel 7 – apiato/apiato
Class
CreateUserByCredentialsTask.php
<?php
namespace AppContainersUserTasks;
use AppContainersUserDataRepositoriesUserRepository;
use AppContainersUserModelsUser;
use AppShipExceptionsCreateResourceFailedException;
use AppShipParentsTasksTask;
use Exception;
use IlluminateSupportFacadesHash;
class CreateUserByCredentialsTask extends Task
{
protected $repository;
public function __construct(UserRepository $repository)
{
$this->repository = $repository;
}
public function run(
bool $isClient = true,
string $email,
string $password,
string $name = null,
string $gender = null,
string $birth = null
): User {
try {
$user = $this->repository->create([
‘password’ => Hash::make($password),
’email’ => $email,
‘name’ => $name,
‘gender’ => $gender,
‘birth’ => $birth,
‘is_client’ => $isClient,
]);
} catch (Exception $e) {
throw (new CreateResourceFailedException())->debug($e);
}
return $user;
}
}
——————————————————
Class UserRepository.php
<?php
namespace AppContainersUserDataRepositories;
use AppShipParentsRepositoriesRepository;
class UserRepository extends Repository
{
protected $fieldSearchable = [
‘name’ => ‘like’,
‘id’ => ‘=’,
’email’ => ‘=’,
‘confirmed’ => ‘=’,
‘created_at’ => ‘like’,
];
}
Here is full source code on github:
https://github.com/apiato/apiato/blob/9.0/app/Containers/User/Tasks/CreateUserByCredentialsTask.php
You still have the class repository, where is usually where are put method as create, search, delete, etc.
I can’t found repository class with methods: create, delete… In my case class UserRepository is empty without any methods.
You can see here full code
https://github.com/apiato/apiato/blob/9.0/app/Containers/User/Tasks/CreateUserByCredentialsTask.php
PHP Framework for building scalable API’s on top of Laravel 7 – apiato/apiato
Then where defined create method in my case?
Here UserRepository class but in this class not defined create method and no other UserRepository class except this
https://github.com/apiato/apiato/blob/9.0/app/Containers/User/Data/Repositories/UserRepository.php
PHP Framework for building scalable API’s on top of Laravel 7 – apiato/apiato
$province = 7;
$Myprovince = (
($province == 6) ? “city-1” :
(($province == 7) ? “city-2” :
(($province == 8) ? “city-3” :
(($province == 30) ? “city-4” : “out of borders”)))
);

okay thank you